-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (70 loc) · 2.05 KB
/
test_PRs.yml
File metadata and controls
75 lines (70 loc) · 2.05 KB
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
name: tests on stable
on:
push:
branches-ignore:
- "develop"
pull_request:
branches: [ "develop" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
skip_check:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
cancel_others: 'true'
paths_ignore: '["**/**.yml", "**/data/**"]'
do_not_skip: '["workflow_dispatch"]'
check:
name: cargo check
needs: skip_check
if: needs.skip_check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions-rs/cargo@v1
with:
command: check
args: --manifest-path ./phylo/Cargo.toml
test:
name: cargo test
needs: skip_check
if: needs.skip_check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: install cargo2junit
run: |
cargo install cargo2junit
- name: Running cargo tests
run: |
cargo test --manifest-path ./phylo/Cargo.toml -- -Z unstable-options --format json --report-time > cargo_test.out
- name: Display cargo test output
if: always()
run: |
cat cargo_test.out
- name: Running cargo2junit
if: always()
run: |
cargo2junit < cargo_test.out > results.xml
- name: Display cargo2junit output
if: always()
run: |
cat results.xml
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: results.xml