-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (144 loc) · 4.58 KB
/
build.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
name: build
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changed-files:
name: changed-files
runs-on: ubuntu-latest
outputs:
simulator: ${{ steps.changed-files-yaml.outputs.simulator_any_changed }}
soem: ${{ steps.changed-files-yaml.outputs.soem_any_changed }}
twincat: ${{ steps.changed-files-yaml.outputs.twincat_any_changed }}
main: ${{ steps.changed-files-yaml.outputs.main_any_changed }}
steps:
- uses: actions/checkout@v4
- id: changed-files-yaml
uses: tj-actions/changed-files@v44
with:
files_yaml: |
simulator:
- 'simulator/**/*.rs'
- 'simulator/Cargo.toml'
soem:
- 'SOEMAUTDServer/**/*.rs'
- 'SOEMAUTDServer/Cargo.toml'
twincat:
- 'TwinCATAUTDServerLightweight/**/*.rs'
- 'TwinCATAUTDServerLightweight/Cargo.toml'
main:
- 'src-tauri/**/*.rs'
- 'src-tauri/Cargo.toml'
- 'src/**/*.svelte'
- '**/*.ts'
- '**/*.js'
- '**/*.html'
- 'package.json'
- 'tsconfig.json'
- 'tsconfig.node.json'
test-simulator:
needs: changed-files
if: ${{ needs.changed-files.outputs.simulator == 'true' }}
name: test-simulator-on-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ${{ matrix.os }}
- run: |
python3 build.py build --simulator
python3 build.py lint --simulator
test-soem:
needs: changed-files
if: ${{ needs.changed-files.outputs.soem == 'true' }}
name: test-soem-on-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ${{ matrix.os }}
- run: |
python3 build.py build --soem
python3 build.py lint --soem
test-twincat:
needs: changed-files
if: ${{ needs.changed-files.outputs.twincat == 'true' }}
name: test-twincat-on-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ${{ matrix.os }}
- run: |
python3 build.py build --twincat
python3 build.py lint --twincat
test-main:
needs: changed-files
if: ${{ needs.changed-files.outputs.main == 'true' }}
name: test-main-on-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
os: ${{ matrix.os }}
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package-lock.json
- run: |
python3 build.py build --main
python3 build.py lint --main
all-tests-passed:
if: ${{ always() }}
name: all-tests-passed
runs-on: ubuntu-latest
needs: [test-simulator, test-soem, test-twincat, test-main]
steps:
- if: ${{ needs.test-simulator.result == 'failure' || needs.test-simulator.result == 'cancelled' || needs.test-soem.result == 'failure' || needs.test-soem.result == 'cancelled' || needs.test-twincat.result == 'failure' || needs.test-twincat.result == 'cancelled' || needs.test-main.result == 'failure' || needs.test-main.result == 'cancelled' }}
run: exit 1
auto-merge:
needs: all-tests-passed
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
if: ${{ always() && !cancelled() && !failure() && github.actor == 'dependabot[bot]' }}
steps:
- run: gh pr merge --rebase --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}