-
Notifications
You must be signed in to change notification settings - Fork 69
73 lines (62 loc) · 2.02 KB
/
pre-review-ci.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
name: Pre Code Review Checks
on:
pull_request:
branches:
- master
merge_group:
branches:
- master
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# Setup dynamic test matrix
setup-test-matrix:
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.rust.outputs.array }}
steps:
- uses: actions/checkout@v2
# Get rust version
- id: rust
run: |
export MSRV=`cargo read-manifest | python -c 'import json,sys; print(json.load(sys.stdin)["rust_version"])'`
export TEST=`cat rust-toolchain`
echo "::set-output name=array::[\"$MSRV\", \"$TEST\", \"stable\"]"
pre-code-review-checks:
needs: setup-test-matrix
strategy:
fail-fast: false
matrix:
target:
- { os: ubuntu-22.04, triple: x86_64-unknown-linux-gnu }
- { os: ubuntu-22.04, triple: i686-unknown-linux-gnu }
- { os: macos-12, triple: x86_64-apple-darwin }
rust: ${{ fromJson(needs.setup-test-matrix.outputs.rust )}}
name: pre-code-review-checks/${{ matrix.target.triple }}/${{ matrix.rust }}
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}-${{ matrix.target.triple }}
components: rustfmt, clippy
# This overwrites the default toolchain with the toolchain specified above.
override: true
# Setup Environments
- name: Setup Environments
run: ./.github/scripts/ci-setup-${{ matrix.target.triple }}.sh
# Build
- name: Build
run: ./.github/scripts/ci-build.sh
# Test
- name: Test
run: ./.github/scripts/ci-test.sh
# Style checks
- name: Style checks
run: ./.github/scripts/ci-style.sh
# Document check
- name: Rustdoc
run: ./.github/scripts/ci-doc.sh