-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
135 lines (134 loc) · 5.08 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: PR
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: install
run: ./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: npm run lint
run: ./scripts/dev-env/run.sh npm run lint
- name: lint-rust.sh
run: |
./scripts/dev-env/run.sh scripts/lint-rust.sh
test-rust:
name: Tests (Rust)
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: test-rust.sh
run: |
./scripts/dev-env/run.sh scripts/test-rust.sh
test-js:
name: Tests (JS)
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: npm install
run: ./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: npm test
run: npm test
build-a32nx:
name: Build and upload A32NX
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
env:
FBW_PRODUCTION_BUILD: 1
AIRCRAFT_PROJECT_PREFIX: a32nx
AIRCRAFT_VARIANT: a320-251n
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Create .env file
run: |
echo FBW_PRODUCTION_BUILD=1 >> fbw-a32nx/.env
echo FBW_TYPECHECK=1 >> fbw-a32nx/.env
echo CLIENT_ID=\"${{ secrets.NAVIGRAPH_CLIENT_ID_A380X }}\" >> fbw-a32nx/.env
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET_A380X }}\" >> fbw-a32nx/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a32nx/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a32nx/.env
echo AIRCRAFT_PROJECT_PREFIX=\"${{ env.AIRCRAFT_PROJECT_PREFIX }}\" >> fbw-a32nx/.env
echo AIRCRAFT_VARIANT=\"${{ env.AIRCRAFT_VARIANT }}\" >> fbw-a32nx/.env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo VITE_BUILD=false >> .env
cat fbw-a32nx/.env
- name: Install dependencies
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Build A32NX
run: |
./scripts/dev-env/run.sh ./scripts/build_a32nx.sh --no-tty -j 4
rm -rf fbw-a32nx/src
docker system prune -af
- name: Generate install.json
if: github.event.pull_request.auto_merge == false
run: |
df -h
node ./scripts/fragment_a32nx.js
cp ./fbw-a32nx/out/build-modules/modules.json ./fbw-a32nx/out/flybywire-aircraft-a320-neo/install.json
node ./scripts/install-source_a32nx.js
- name: Upload PR artifact
uses: actions/upload-artifact@v4
if: github.event.pull_request.auto_merge == false
with:
name: flybywire-aircraft-a320-neo
path: ./fbw-a32nx/out/flybywire-aircraft-a320-neo/
build-a380x:
name: Build and upload A380X
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
env:
FBW_PRODUCTION_BUILD: 1
AIRCRAFT_PROJECT_PREFIX: a380x
AIRCRAFT_VARIANT: a380-842
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Create .env file
# We do not set FBW_TYPECHECK=1 here, as there are still things to fix in the A380 instruments
run: |
echo FBW_PRODUCTION_BUILD=1 >> fbw-a380x/.env
echo CLIENT_ID=\"${{ secrets.NAVIGRAPH_CLIENT_ID }}\" >> fbw-a380x/.env
echo CLIENT_SECRET=\"${{ secrets.NAVIGRAPH_CLIENT_SECRET }}\" >> fbw-a380x/.env
echo CHARTFOX_SECRET=\"${{ secrets.CHARTFOX_SECRET }}\" >> fbw-a380x/.env
echo SENTRY_DSN=\"${{ secrets.SENTRY_DSN }}\" >> fbw-a380x/.env
echo LOCALAZY_READ_KEY=${{ secrets.LOCALAZY_READ_KEY }} >> .env
echo AIRCRAFT_PROJECT_PREFIX=\"${{ env.AIRCRAFT_PROJECT_PREFIX }}\" >> fbw-a380x/.env
echo AIRCRAFT_VARIANT=\"${{ env.AIRCRAFT_VARIANT }}\" >> fbw-a380x/.env
echo VITE_BUILD=false >> .env
cat fbw-a380x/.env
- name: Install dependencies
run: |
./scripts/dev-env/run.sh ./scripts/setup.sh --clean
- name: Build A380X
run: |
./scripts/dev-env/run.sh ./scripts/build_a380x.sh --no-tty -j 4
rm -rf fbw-a380x/src
docker system prune -af
- name: Generate install.json
if: github.event.pull_request.auto_merge == false
run: |
df -h
node ./scripts/fragment_a380x.js
cp ./fbw-a380x/out/build-modules/modules.json ./fbw-a380x/out/flybywire-aircraft-a380-842/install.json
node ./scripts/install-source_a380x.js
- name: Upload PR artifact
uses: actions/upload-artifact@v4
if: github.event.pull_request.auto_merge == false
with:
name: flybywire-aircraft-a380-842
path: ./fbw-a380x/out/flybywire-aircraft-a380-842/