|
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 |
15 | 37 | steps: |
16 | | - - name: Checkout Crate |
17 | | - uses: actions/checkout@v3 |
18 | | - - name: Checkout Toolchain |
19 | | - # https://github.com/dtolnay/rust-toolchain |
| 38 | + - name: "Checkout repo" |
| 39 | + uses: actions/checkout@v4 |
| 40 | + - name: "Checkout maintainer tools" |
| 41 | + uses: ./.github/actions/checkout-maintainer-tools |
| 42 | + - name: "Select toolchain" |
20 | 43 | 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 |
| 44 | + - name: "Set dependencies" |
| 45 | + run: cp Cargo-latest.lock Cargo.lock |
| 46 | + - name: "Run test script" |
| 47 | + run: ./maintainer-tools/ci/run_task.sh stable |
30 | 48 |
|
31 | 49 | Nightly: |
32 | 50 | name: Test - nightly toolchain |
| 51 | + needs: Prepare |
33 | 52 | runs-on: ubuntu-latest |
34 | 53 | strategy: |
35 | 54 | fail-fast: false |
36 | 55 | 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 |
| 56 | + - name: "Checkout repo" |
| 57 | + uses: actions/checkout@v4 |
| 58 | + - name: "Checkout maintainer tools" |
| 59 | + uses: ./.github/actions/checkout-maintainer-tools |
| 60 | + - name: "Select toolchain" |
| 61 | + uses: dtolnay/rust-toolchain@v1 |
| 62 | + with: |
| 63 | + toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 64 | + - name: "Set dependencies" |
| 65 | + run: cp Cargo-latest.lock Cargo.lock |
| 66 | + - name: "Run test script" |
| 67 | + run: ./maintainer-tools/ci/run_task.sh nightly |
50 | 68 |
|
51 | 69 | MSRV: |
52 | | - name: Test - 1.63.0 toolchain |
| 70 | + name: Test - MSRV |
| 71 | + needs: Prepare |
53 | 72 | runs-on: ubuntu-latest |
54 | 73 | strategy: |
55 | 74 | fail-fast: false |
56 | 75 | steps: |
57 | | - - name: Checkout Crate |
58 | | - uses: actions/checkout@v3 |
59 | | - - name: Checkout Toolchain |
60 | | - uses: dtolnay/rust-toolchain@1.63.0 |
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 |
| 76 | + - name: "Checkout repo" |
| 77 | + uses: actions/checkout@v4 |
| 78 | + - name: "Checkout maintainer tools" |
| 79 | + uses: ./.github/actions/checkout-maintainer-tools |
| 80 | + - name: "Select toolchain" |
| 81 | + uses: dtolnay/rust-toolchain@stable |
| 82 | + with: |
| 83 | + toolchain: ${{ needs.Prepare.outputs.msrv_version }} |
| 84 | + - name: "Set dependencies" |
| 85 | + run: cp Cargo-latest.lock Cargo.lock |
| 86 | + - name: "Run test script" |
| 87 | + run: ./maintainer-tools/ci/run_task.sh msrv |
70 | 88 |
|
71 | | - Fuzz: |
72 | | - name: Fuzztests - 1.63.0 toolchain |
| 89 | + Lint: |
| 90 | + name: Lint - nightly toolchain |
| 91 | + needs: Prepare |
73 | 92 | runs-on: ubuntu-latest |
74 | 93 | strategy: |
75 | 94 | fail-fast: false |
| 95 | + matrix: |
| 96 | + dep: [recent] |
76 | 97 | steps: |
77 | | - - name: Checkout Crate |
78 | | - uses: actions/checkout@v3 |
79 | | - - name: Checkout Toolchain |
80 | | - uses: dtolnay/rust-toolchain@1.63.0 |
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 |
| 98 | + - name: "Checkout repo" |
| 99 | + uses: actions/checkout@v4 |
| 100 | + - name: "Checkout maintainer tools" |
| 101 | + uses: ./.github/actions/checkout-maintainer-tools |
| 102 | + - name: "Select toolchain" |
| 103 | + uses: dtolnay/rust-toolchain@v1 |
| 104 | + with: |
| 105 | + toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 106 | + - name: Install clippy |
| 107 | + run: rustup component add clippy |
| 108 | + - name: "Set dependencies" |
| 109 | + run: cp Cargo-latest.lock Cargo.lock |
| 110 | + - name: "Run test script" |
| 111 | + run: ./maintainer-tools/ci/run_task.sh lint |
92 | 112 |
|
93 | | - Integration: |
94 | | - name: Integration tests - stable |
| 113 | + Docs: |
| 114 | + name: Docs - stable toolchain |
95 | 115 | runs-on: ubuntu-latest |
96 | 116 | strategy: |
97 | 117 | fail-fast: false |
| 118 | + matrix: |
| 119 | + dep: [recent] |
98 | 120 | steps: |
99 | | - - name: Checkout Crate |
100 | | - uses: actions/checkout@v3 |
101 | | - - name: Checkout Toolchain |
| 121 | + - name: "Checkout repo" |
| 122 | + uses: actions/checkout@v4 |
| 123 | + - name: "Checkout maintainer tools" |
| 124 | + uses: ./.github/actions/checkout-maintainer-tools |
| 125 | + - name: "Select toolchain" |
102 | 126 | 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 |
| 127 | + - name: "Set dependencies" |
| 128 | + run: cp Cargo-latest.lock Cargo.lock |
| 129 | + - name: "Run test script" |
| 130 | + run: ./maintainer-tools/ci/run_task.sh docs |
| 131 | + |
| 132 | + Docsrs: |
| 133 | + name: Docs - nightly toolchain |
| 134 | + needs: Prepare |
| 135 | + runs-on: ubuntu-latest |
| 136 | + strategy: |
| 137 | + fail-fast: false |
| 138 | + matrix: |
| 139 | + dep: [recent] |
| 140 | + steps: |
| 141 | + - name: "Checkout repo" |
| 142 | + uses: actions/checkout@v4 |
| 143 | + - name: "Checkout maintainer tools" |
| 144 | + uses: ./.github/actions/checkout-maintainer-tools |
| 145 | + - name: "Select toolchain" |
| 146 | + uses: dtolnay/rust-toolchain@v1 |
| 147 | + with: |
| 148 | + toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 149 | + - name: "Set dependencies" |
| 150 | + run: cp Cargo-latest.lock Cargo.lock |
| 151 | + - name: "Run test script" |
| 152 | + run: ./maintainer-tools/ci/run_task.sh docsrs |
| 153 | + |
| 154 | +# Format: |
| 155 | +# name: Format - nightly toolchain |
| 156 | +# needs: Prepare |
| 157 | +# runs-on: ubuntu-latest |
| 158 | +# strategy: |
| 159 | +# fail-fast: false |
| 160 | +# steps: |
| 161 | +# - name: "Checkout repo" |
| 162 | +# uses: actions/checkout@v4 |
| 163 | +# - name: "Select toolchain" |
| 164 | +# uses: dtolnay/rust-toolchain@v1 |
| 165 | +# with: |
| 166 | +# toolchain: ${{ needs.Prepare.outputs.nightly_version }} |
| 167 | +# - name: "Install rustfmt" |
| 168 | +# run: rustup component add rustfmt |
| 169 | +# - name: "Check formatting" |
| 170 | +# run: cargo fmt --all -- --check |
112 | 171 |
|
113 | 172 | Wasm: |
114 | 173 | name: Check WASM |
|
0 commit comments