|
1 | | -on: |
| 1 | +on: # yamllint disable-line rule:truthy |
| 2 | + pull_request: |
2 | 3 | push: |
3 | 4 | branches: |
4 | 5 | - master |
5 | | - pull_request: {} |
| 6 | + - 'test-ci/**' |
6 | 7 |
|
7 | 8 | name: Continuous integration |
8 | 9 |
|
9 | 10 | jobs: |
| 11 | + Prepare: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + outputs: |
| 14 | + nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }} |
| 15 | + msrv_version: ${{ steps.read_msrv.outputs.msrv_version }} |
| 16 | + steps: |
| 17 | + - name: "Checkout repo" |
| 18 | + uses: actions/checkout@v4 |
| 19 | + - name: "Read nightly version" |
| 20 | + id: read_toolchain |
| 21 | + run: | |
| 22 | + set -euo pipefail |
| 23 | + version=$(cat nightly-version) |
| 24 | + echo "nightly_version=$version" >> $GITHUB_OUTPUT |
| 25 | + - name: Read MSRV from clippy.toml |
| 26 | + id: read_msrv |
| 27 | + run: | |
| 28 | + set -euo pipefail |
| 29 | + msrv=$(grep '^msrv *= *"' clippy.toml | sed -E 's/.*"([^"]+)".*/\1/') |
| 30 | + echo "msrv_version=$msrv" >> "$GITHUB_OUTPUT" |
| 31 | +
|
10 | 32 | Stable: |
11 | 33 | name: Test - stable toolchain |
12 | 34 | runs-on: ubuntu-latest |
13 | 35 | strategy: |
14 | 36 | fail-fast: false |
| 37 | + matrix: |
| 38 | + dep: [minimal, recent] |
15 | 39 | steps: |
16 | | - - name: Checkout Crate |
17 | | - uses: actions/checkout@v3 |
18 | | - - name: Checkout Toolchain |
19 | | - # https://github.com/dtolnay/rust-toolchain |
| 40 | + - name: "Checkout repo" |
| 41 | + uses: actions/checkout@v4 |
| 42 | + - name: "Checkout maintainer tools" |
| 43 | + uses: ./.github/actions/checkout-maintainer-tools |
| 44 | + - name: "Select toolchain" |
20 | 45 | uses: dtolnay/rust-toolchain@stable |
21 | | - - name: Running test script |
22 | | - env: |
23 | | - DO_DOCS: true |
24 | | - DO_DOCSRS: false |
25 | | - DO_FUZZ: false |
26 | | - DO_INTEGRATION: false |
27 | | - DO_LINT: true |
28 | | - DO_FEATURE_MATRIX: true |
29 | | - run: ./contrib/test.sh |
| 46 | + - name: "Set dependencies" |
| 47 | + run: cp Cargo-latest.lock Cargo.lock |
| 48 | + - name: "Run test script" |
| 49 | + run: ./maintainer-tools/ci/run_task.sh stable |
30 | 50 |
|
31 | 51 | Nightly: |
32 | 52 | name: Test - nightly toolchain |
| 53 | + needs: Prepare |
33 | 54 | runs-on: ubuntu-latest |
34 | 55 | strategy: |
35 | 56 | fail-fast: false |
| 57 | + matrix: |
| 58 | + dep: [minimal, recent] |
36 | 59 | steps: |
37 | | - - name: Checkout Crate |
38 | | - uses: actions/checkout@v3 |
39 | | - - name: Checkout Toolchain |
40 | | - uses: dtolnay/rust-toolchain@nightly |
41 | | - - name: Running test script |
42 | | - env: |
43 | | - DO_DOCS: true |
44 | | - DO_DOCSRS: true |
45 | | - DO_FUZZ: false |
46 | | - DO_INTEGRATION: false |
47 | | - DO_LINT: false |
48 | | - DO_FEATURE_MATRIX: true |
49 | | - run: ./contrib/test.sh |
| 60 | + - name: "Checkout repo" |
| 61 | + uses: actions/checkout@v4 |
| 62 | + - name: "Checkout maintainer tools" |
| 63 | + uses: ./.github/actions/checkout-maintainer-tools |
| 64 | + - name: "Select toolchain" |
| 65 | + uses: dtolnay/rust-toolchain@v1 |
| 66 | + with: |
| 67 | + toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 68 | + - name: "Set dependencies" |
| 69 | + run: cp Cargo-latest.lock Cargo.lock |
| 70 | + - name: "Run test script" |
| 71 | + run: ./maintainer-tools/ci/run_task.sh nightly |
50 | 72 |
|
51 | 73 | MSRV: |
52 | | - name: Test - 1.63.0 toolchain |
| 74 | + name: Test - MSRV |
| 75 | + needs: Prepare |
53 | 76 | runs-on: ubuntu-latest |
54 | 77 | strategy: |
55 | 78 | fail-fast: false |
| 79 | + matrix: |
| 80 | + dep: [minimal, recent] |
56 | 81 | steps: |
57 | | - - name: Checkout Crate |
58 | | - uses: actions/checkout@v3 |
59 | | - - name: Checkout Toolchain |
60 | | - |
61 | | - - name: Running test script |
62 | | - env: |
63 | | - DO_DOCS: false |
64 | | - DO_DOCSRS: false |
65 | | - DO_FUZZ: false |
66 | | - DO_INTEGRATION: false |
67 | | - DO_LINT: false |
68 | | - DO_FEATURE_MATRIX: true |
69 | | - run: ./contrib/test.sh |
| 82 | + - name: "Checkout repo" |
| 83 | + uses: actions/checkout@v4 |
| 84 | + - name: "Checkout maintainer tools" |
| 85 | + uses: ./.github/actions/checkout-maintainer-tools |
| 86 | + - name: "Select toolchain" |
| 87 | + uses: dtolnay/rust-toolchain@stable |
| 88 | + with: |
| 89 | + toolchain: ${{ needs.Prepare.outputs.msrv_version }} |
| 90 | + - name: "Set dependencies" |
| 91 | + run: cp Cargo-latest.lock Cargo.lock |
| 92 | + - name: "Run test script" |
| 93 | + run: ./maintainer-tools/ci/run_task.sh msrv |
70 | 94 |
|
71 | | - Fuzz: |
72 | | - name: Fuzztests - 1.63.0 toolchain |
| 95 | + Lint: |
| 96 | + name: Lint - nightly toolchain |
| 97 | + needs: Prepare |
73 | 98 | runs-on: ubuntu-latest |
74 | 99 | strategy: |
75 | 100 | fail-fast: false |
| 101 | + matrix: |
| 102 | + dep: [recent] |
76 | 103 | steps: |
77 | | - - name: Checkout Crate |
78 | | - uses: actions/checkout@v3 |
79 | | - - name: Checkout Toolchain |
80 | | - |
81 | | - - name: Install test dependencies |
82 | | - run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev |
83 | | - - name: Running test script |
84 | | - env: |
85 | | - DO_DOCS: false |
86 | | - DO_DOCSRS: false |
87 | | - DO_FUZZ: true |
88 | | - DO_INTEGRATION: false |
89 | | - DO_LINT: false |
90 | | - DO_FEATURE_MATRIX: false |
91 | | - run: ./contrib/test.sh |
| 104 | + - name: "Checkout repo" |
| 105 | + uses: actions/checkout@v4 |
| 106 | + - name: "Checkout maintainer tools" |
| 107 | + uses: ./.github/actions/checkout-maintainer-tools |
| 108 | + - name: "Select toolchain" |
| 109 | + uses: dtolnay/rust-toolchain@v1 |
| 110 | + with: |
| 111 | + toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 112 | + - name: Install clippy |
| 113 | + run: rustup component add clippy |
| 114 | + - name: "Set dependencies" |
| 115 | + run: cp Cargo-latest.lock Cargo.lock |
| 116 | + - name: "Run test script" |
| 117 | + run: ./maintainer-tools/ci/run_task.sh lint |
92 | 118 |
|
93 | | - Integration: |
94 | | - name: Integration tests - stable |
| 119 | + Docs: |
| 120 | + name: Docs - stable toolchain |
95 | 121 | runs-on: ubuntu-latest |
96 | 122 | strategy: |
97 | 123 | fail-fast: false |
| 124 | + matrix: |
| 125 | + dep: [recent] |
98 | 126 | steps: |
99 | | - - name: Checkout Crate |
100 | | - uses: actions/checkout@v3 |
101 | | - - name: Checkout Toolchain |
| 127 | + - name: "Checkout repo" |
| 128 | + uses: actions/checkout@v4 |
| 129 | + - name: "Checkout maintainer tools" |
| 130 | + uses: ./.github/actions/checkout-maintainer-tools |
| 131 | + - name: "Select toolchain" |
102 | 132 | uses: dtolnay/rust-toolchain@stable |
103 | | - - name: Running test script |
104 | | - env: |
105 | | - DO_DOCS: false |
106 | | - DO_DOCSRS: false |
107 | | - DO_FUZZ: false |
108 | | - DO_INTEGRATION: true |
109 | | - DO_LINT: false |
110 | | - DO_FEATURE_MATRIX: false |
111 | | - run: ./contrib/test.sh |
| 133 | + - name: "Set dependencies" |
| 134 | + run: cp Cargo-latest.lock Cargo.lock |
| 135 | + - name: "Run test script" |
| 136 | + run: ./maintainer-tools/ci/run_task.sh docs |
| 137 | + |
| 138 | + Docsrs: |
| 139 | + name: Docs - nightly toolchain |
| 140 | + needs: Prepare |
| 141 | + runs-on: ubuntu-latest |
| 142 | + strategy: |
| 143 | + fail-fast: false |
| 144 | + matrix: |
| 145 | + dep: [recent] |
| 146 | + steps: |
| 147 | + - name: "Checkout repo" |
| 148 | + uses: actions/checkout@v4 |
| 149 | + - name: "Checkout maintainer tools" |
| 150 | + uses: ./.github/actions/checkout-maintainer-tools |
| 151 | + - name: "Select toolchain" |
| 152 | + uses: dtolnay/rust-toolchain@v1 |
| 153 | + with: |
| 154 | + toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 155 | + - name: "Set dependencies" |
| 156 | + run: cp Cargo-latest.lock Cargo.lock |
| 157 | + - name: "Run test script" |
| 158 | + run: ./maintainer-tools/ci/run_task.sh docsrs |
| 159 | + |
| 160 | + Format: |
| 161 | + name: Format - nightly toolchain |
| 162 | + needs: Prepare |
| 163 | + runs-on: ubuntu-latest |
| 164 | + strategy: |
| 165 | + fail-fast: false |
| 166 | + steps: |
| 167 | + - name: "Checkout repo" |
| 168 | + uses: actions/checkout@v4 |
| 169 | + - name: "Select toolchain" |
| 170 | + uses: dtolnay/rust-toolchain@v1 |
| 171 | + with: |
| 172 | + toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 173 | + - name: "Install rustfmt" |
| 174 | + run: rustup component add rustfmt |
| 175 | + - name: "Check formatting" |
| 176 | + run: cargo fmt --all -- --check |
112 | 177 |
|
113 | 178 | Wasm: |
114 | 179 | name: Check WASM |
|
0 commit comments