-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (64 loc) · 2 KB
/
pr.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
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
name: Label, Build & Lint PR
jobs:
autolabel:
uses: ./.github/workflows/autolabel.yml
secrets: inherit
filter:
name: Register changed paths
if: ${{ !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name , 'release') }}
runs-on: ubuntu-latest
outputs:
js-interface: ${{ steps.changes.outputs.js-interface }}
example: ${{ steps.changes.outputs.example }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
js-interface:
- 'src/js/**'
lint:
name: Lint 📝
runs-on: ubuntu-latest
needs: [filter]
if: ${{ needs.filter.outputs.js-interface == 'true' && !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name , 'release') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install node modules
run: npm ci
- name: Run linting
run: npm run lint:js -- --max-warnings 0
build-test:
name: Build & test 🛠️
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name , 'release') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
filter: blob:none
- name: Create env file
run: |
touch .env
echo NAVIGATION_DATA_SIGNED_URL=${{ secrets.NAVIGATION_DATA_SIGNED_URL }} >> .env
- name: Build WASM module
run: npm run build:wasm-workflow
- name: Test
run: npm run test-workflow
- name: Upload WASM module to GitHub
uses: actions/upload-artifact@v4
with:
name: msfs_navigation_data_interface.wasm
path: ./out/msfs_navigation_data_interface.wasm