forked from krzema12/kotlin-python
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 3.12 KB
/
build_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build and test
on:
push:
branches:
- "*"
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
testTask:
- pythonTest
- microPythonTest
steps:
- name: Fetch the whole git history (to be able to calculate some stats based on it)
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Kotlin for scripting
run: sudo snap install --classic kotlin
- name: Install MicroPython
run: sudo snap install micropython
if: ${{ matrix.testTask == 'microPythonTest' }}
- name: Disable old Java for Kotlin
run: echo "kotlin.build.isObsoleteJdkOverrideEnabled=true" > local.properties
- name: Clean
run: JDK_9="$JAVA_HOME" ./gradlew clean
- name: Run ast tests
run: JDK_9="$JAVA_HOME" ./gradlew :python:ast:test
if: always()
- name: Build
run: JDK_9="$JAVA_HOME" ./gradlew dist
- name: Compile python.kt to Python
run: dist/kotlinc/bin/kotlinc-py -libraries dist/kotlinc/lib/kotlin-stdlib-js.jar -Xir-produce-js -output out_ir.py python/experiments/python.kt
if: always()
- name: Compare out_ir.py
run: diff -u out_ir.py python/experiments/generated/out_ir.py
if: always()
- name: Compile python.kt to JavaScript
run: dist/kotlinc/bin/kotlinc-js -libraries dist/kotlinc/lib/kotlin-stdlib-js.jar -Xir-produce-js -Xir-property-lazy-initialization -output out-ir.js python/experiments/python.kt
if: always()
- name: Compare out-ir.js
run: diff -u out-ir.js python/experiments/generated/out-ir.js
if: always()
- name: Generate stats about missing IR mapping
run: less python/experiments/generated/out_ir.py | grep -Po "visit[a-zA-Z0-9_]+" | sort | uniq -c | sort -nr > missing.txt
if: always()
- name: Compare missing.txt
run: diff -u missing.txt python/experiments/generated/missing.txt
if: always()
- name: Run end-to-end tests
run: JDK_9="$JAVA_HOME" python/e2e-tests/run.sh
if: ${{ matrix.testTask == 'pythonTest' }} # TODO: run e2e tests for MicroPython too (#85)
- name: Run box tests (succeed even if they fail)
run: JDK_9="$JAVA_HOME" ./gradlew :python:box.tests:${{ matrix.testTask }} || true
if: always()
- name: Generate box tests reports
run: python/experiments/generate-box-tests-reports.main.kts --test-task=${{ matrix.testTask }} --failed-tests-report-path=failed-tests.txt --box-tests-report-path=box-tests-report.tsv --failure-count-report-path=failure-count.tsv
if: always()
- name: Compare failed-tests.txt
run: diff -u failed-tests.txt python/box.tests/reports/${{ matrix.testTask }}/failed-tests.txt
if: always()
- name: Compare box-tests-report.tsv
run: diff -u box-tests-report.tsv python/box.tests/reports/${{ matrix.testTask }}/box-tests-report.tsv
if: always()
- name: Compare failure-count.tsv
run: diff -u failure-count.tsv python/box.tests/reports/${{ matrix.testTask }}/failure-count.tsv
if: always()