-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (139 loc) · 4.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: pr
on:
pull_request:
branches: [ "main" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
changed-files:
name: changed-files
runs-on: ubuntu-latest
outputs:
src: ${{ steps.changed-files-yaml.outputs.src_any_changed }}
steps:
- uses: actions/checkout@v4
- id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
src:
- '**/*.rs'
- '**/Cargo.toml'
test:
needs: changed-files
if: ${{ needs.changed-files.outputs.src == 'true' }}
name: test-on-${{ matrix.os }}${{ matrix.features && '-' }}${{ matrix.features }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: macos-latest
- os: ubuntu-latest
features: "async remote twincat remote_twincat simulator"
- os: ubuntu-latest
features: "use_meter left_handed"
- os: ubuntu-latest
features: "lightweight async-trait lightweight_server"
- os: ubuntu-latest
features: "dynamic_freq"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- run: cargo make check --features "${{ matrix.features }}"
all-tests-passed:
if: ${{ always() }}
name: all-tests-passed
runs-on: ubuntu-latest
needs: test
steps:
- if: ${{ needs.test.result == 'failure' || needs.test.result == 'cancelled' }}
run: exit 1
miri:
needs: changed-files
if: ${{ needs.changed-files.outputs.src == 'true' }}
name: test-with-miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
toolchain: nightly
components: miri
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- run: cargo make miri
build-docs:
needs: changed-files
if: ${{ needs.changed-files.outputs.src == 'true' }}
name: build-docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
toolchain: nightly
- run: cargo make doc
- uses: dtolnay/install@cargo-docs-rs
- run: |
cargo +nightly docs-rs -pautd3
cargo +nightly docs-rs -pautd3-core
cargo +nightly docs-rs -pautd3-derive
cargo +nightly docs-rs -pautd3-driver
cargo +nightly docs-rs -pautd3-firmware-emulator
cargo +nightly docs-rs -pautd3-gain-holo
cargo +nightly docs-rs -pautd3-link-simulator
cargo +nightly docs-rs -pautd3-link-twincat
cargo +nightly docs-rs -pautd3-modulation-audio-file
cargo +nightly docs-rs -pautd3-protobuf
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/setup-build
with:
components: llvm-tools
- uses: SierraSoftworks/setup-grcov@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: latest
- run: cargo make cov lcov
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage
disable_search: true
fail_ci_if_error: true
auto-merge:
needs:
- all-tests-passed
- miri
- build-docs
- coverage
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}}