-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (88 loc) · 2.9 KB
/
test-and-release.yaml
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
name: Test and Release
on:
push:
env:
# For chalk: https://github.com/chalk/chalk#supportscolor
FORCE_COLOR: 3
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
parse:
name: "Run parse examples"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci --no-audit --ignore-scripts
- name: Parse examples
run: |
npx tsx parse.ts parser/test-data/feature/Example.feature.md
npx tsx parse.ts parser/test-data/feature/Highlander.feature.md
npx tsx parse.ts examples/mars-rover/MarsRover.feature.md
mars-rover:
name: "Run Mars Rover example"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci --no-audit --ignore-scripts
- name: Mars Rover Example
run: |
npx tsx examples/mars-rover/tests.ts > mars-rover.json
cat mars-rover.json | npx tsx reporter/console-cli.ts
cat mars-rover.json | npx tsx reporter/markdown-cli.ts >> $GITHUB_STEP_SUMMARY
firmware:
name: "Run Firmware example"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci --no-audit --ignore-scripts
- name: Firmware Example
run: |
npx tsx examples/firmware/tests.ts > firmware.json
cat firmware.json | npx tsx reporter/console-cli.ts
cat firmware.json | npx tsx reporter/markdown-cli.ts >> $GITHUB_STEP_SUMMARY
tests:
name: "Test and Release"
needs: [parse, mars-rover, firmware]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci --no-audit
- name: Compile TypeScript
run: npx tsc
- name: Check source code with eslint
run: npx eslint ./
- name: Check if source code is properly formatted
run: npx prettier -c ./
- name: Run Unit Tests
run: npm test
- name: Parse examples
run: |
npx tsx parse.ts parser/test-data/feature/Example.feature.md
npx tsx parse.ts parser/test-data/feature/Highlander.feature.md
npx tsx parse.ts examples/mars-rover/MarsRover.feature.md
- name: Run examples
run: |
npx tsx examples/mars-rover/tests.ts
npx tsx examples/firmware/tests.ts
- name: Semantic release
run: npx semantic-release