Skip to content

Commit 435e6a3

Browse files
committed
👷 add compatibility tests to CI
1 parent 322f5bd commit 435e6a3

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: gradle/actions/setup-gradle@v4
3535
- name: Run ktfmtCheck (qs-kotlin)
3636
run: ./gradlew :qs-kotlin:ktfmtCheck --stacktrace
37-
jvm-tests:
37+
jvm_tests:
3838
name: JVM tests (Java ${{ matrix.java }})
3939
runs-on: ubuntu-latest
4040
needs: style
@@ -66,7 +66,7 @@ jobs:
6666
name: qs-kotlin-jvm-${{ matrix.java }}
6767
env:
6868
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
69-
android-aar:
69+
android_aar:
7070
name: Android AAR (AGP) + unit tests
7171
runs-on: ubuntu-latest
7272
needs: style
@@ -90,3 +90,41 @@ jobs:
9090
uses: gradle/actions/setup-gradle@v4
9191
- name: Assemble AAR + run unit tests
9292
run: ./gradlew :qs-kotlin-android:assembleRelease :qs-kotlin-android:testReleaseUnitTest --stacktrace
93+
ensure_compatibility:
94+
name: Ensure compatibility with qs
95+
needs: style
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
- name: Set up Node.js
101+
uses: actions/setup-node@v4
102+
with:
103+
node-version: '20'
104+
- name: Install JS dependencies
105+
run: npm ci
106+
working-directory: comparison/js
107+
- name: Run Kotlin comparison
108+
run: ./gradlew -q :comparison:run --console=plain --warning-mode=none > kotlin.out
109+
- name: Run Node comparison
110+
run: node comparison/js/qs.js > node.out
111+
- name: Show first lines (debug)
112+
if: ${{ always() }}
113+
run: |
114+
echo "=== Kotlin (first 80 lines) ==="
115+
head -n 80 kotlin.out || true
116+
echo "=== Node (first 80 lines) ==="
117+
head -n 80 node.out || true
118+
- name: Diff outputs
119+
run: |
120+
set -eo pipefail
121+
diff -u node.out kotlin.out > diff.out || (echo "::error::Differences found between Node and Kotlin outputs. See artifact diff.out"; exit 1)
122+
- name: Upload diff artifacts on failure
123+
if: failure()
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: comparison-diff
127+
path: |
128+
node.out
129+
kotlin.out
130+
diff.out

0 commit comments

Comments
 (0)