-
Notifications
You must be signed in to change notification settings - Fork 1
161 lines (146 loc) · 4.33 KB
/
build-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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build, lint, test
on: [ push, pull_request ]
jobs:
build-lint:
name: Build & lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- name: Build
run: npm run build
- name: Check if setup.js up-to-date if this is not a regular push event
if: github.event_name != 'push'
run: git diff --exit-code -s -- dist/ || echo "::warning::setup.js should be updated"
- name: Lint
run: npm run lint-only
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1
commit-build:
name: Commit setup.js
if: github.event_name == 'push'
needs: build-lint
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Commit setup.js
uses: EndBug/add-and-commit@v9
with:
message: Update setup.js
add: dist/
default_author: github_actions
author_name: Build bot
pathspec_error_handling: exitImmediately
test-fasm1:
name: Test install some fasm 1 versions
needs: build-lint
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
version: [ latest, 1.73.* ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Run setup-fasm
id: fasm
uses: ./
with:
edition: fasm1
version: ${{ matrix.version }}
fallback-to-previous-compatible: false
- name: Check installed version
run: |
(fasm.x64 || fasm || fasm.o || FASM.EXE) 2>/dev/null || true
(fasm.x64 || fasm || fasm.o || FASM.EXE) 2>&1 | grep -qF 'flat assembler version ${{ steps.fasm.outputs.version }}'
shell: sh
- name: Check INCLUDE envvar
if: matrix.os == 'windows-latest'
run: |
echo INCLUDE = $INCLUDE
[ -d "$INCLUDE" ]
shell: sh
test-fasmg:
name: Test install latest fasm g version
needs: build-lint
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Run setup-fasm
id: fasm
uses: ./
with:
edition: fasmg
fallback-to-previous-compatible: false
fasmg-download-packages: true
fasmg-include-packages: utility, x86
- name: Check installed version
run: |
(fasmg.x64 || fasmg || fasmg.o || fasmg.exe) 2>/dev/null || true
(fasmg.x64 || fasmg || fasmg.o || fasmg.exe) 2>&1 | grep -qF 'flat assembler version g.${{ steps.fasm.outputs.version }}'
shell: sh
- name: Check INCLUDE envvar
run: |
echo INCLUDE = $INCLUDE
set -e
IFS=';' read -ra dirs <<< "$INCLUDE"
for dir in "${dirs[@]}"
do
[ -d "$dir" ] # Exists and is directory?
done
[ ${#dirs[@]} -eq 3 ] # 3 items (packages root, utility, x86)
shell: bash
test-fasmarm:
name: Test install latest FASMARM version
needs: build-lint
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Run setup-fasm
id: fasm
uses: ./
with:
edition: fasmarm
fallback-to-previous-compatible: false
- name: Check installed version
run: |
(fasmarm.x64 || fasmarm || fasmarm.o || FASMARM.EXE) 2>/dev/null || true
(fasmarm.x64 || fasmarm || fasmarm.o || FASMARM.EXE) 2>&1 | grep -qF 'flat assembler for ARM'
shell: sh
- name: Check INCLUDE envvar
run: |
echo INCLUDE = $INCLUDE
[ -d "$INCLUDE" ]
shell: bash