-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (58 loc) · 1.94 KB
/
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
name: test
on:
push:
branches: [ "main" ]
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
test-js:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'js'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'js/.nvmrc'
cache: 'npm'
cache-dependency-path: 'js/package-lock.json'
- run: npm ci
- run: npm test
test-java:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
working-directory: 'java'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/actions/setup-gradle@v3
- name: Java converter tests
run: ./gradlew test
- name: Test running CLI
run: |
./gradlew cli
java -jar ./build/libs/mvt2mlt-1.0-SNAPSHOT.jar -mvt ../test/fixtures/omt/10_530_682.mvt -mlt output/varint.mvt
java -jar ./build/libs/mvt2mlt-1.0-SNAPSHOT.jar -mvt ../test/fixtures/omt/10_530_682.mvt -advanced -mlt output/advanced.mvt
python -c 'import os; expected=66984; ts=os.path.getsize("output/varint.mvt"); assert ts == expected, f"tile size changed from expected ({expected}), got: {ts}"'
python -c 'import os; expected=64728; ts=os.path.getsize("output/advanced.mvt"); assert ts == expected, f"tile size changed from expected ({expected}), got: {ts}"'
# This final step is needed to mark the whole workflow as successful
done:
# Don't change its name - it is used by the merge protection rules
name: CI Finished
runs-on: ubuntu-latest
# List of all the other jobs that must pass for this job to start
needs: [ test-java, test-js ]
steps:
- name: Finished
run: echo "CI finished successfully"