|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | build: |
| 12 | + name: build +${{ matrix.toolchain }} ${{ matrix.flags }} |
12 | 13 | runs-on: ubuntu-latest |
| 14 | + timeout-minutes: 10 |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + toolchain: [stable, nightly] |
| 19 | + flags: |
| 20 | + - "" |
| 21 | + - --via-ir |
| 22 | + - --use solc:0.8.17 --via-ir |
| 23 | + - --use solc:0.8.17 |
| 24 | + - --use solc:0.8.0 |
| 25 | + - --use solc:0.7.6 |
| 26 | + - --use solc:0.7.0 |
| 27 | + - --use solc:0.6.2 |
| 28 | + - --use solc:0.6.12 |
13 | 29 | steps: |
14 | 30 | - uses: actions/checkout@v4 |
15 | | - |
16 | | - - name: Install Foundry |
17 | | - uses: foundry-rs/foundry-toolchain@v1 |
18 | | - with: |
19 | | - version: nightly |
20 | | - |
21 | | - - name: Print forge version |
22 | | - run: forge --version |
23 | | - |
24 | | - # Backwards compatibility checks: |
25 | | - # - the oldest and newest version of each supported minor version |
26 | | - # - versions with specific issues |
27 | | - - name: Check compatibility with latest |
28 | | - if: always() |
29 | | - run: | |
30 | | - output=$(forge build --skip test) |
31 | | - if echo "$output" | grep -q "Warning"; then |
32 | | - echo "$output" |
33 | | - exit 1 |
34 | | - fi |
35 | | -
|
36 | | - - name: Check compatibility with 0.8.0 |
37 | | - if: always() |
38 | | - run: | |
39 | | - output=$(forge build --skip test --use solc:0.8.0) |
40 | | - if echo "$output" | grep -q "Warning"; then |
41 | | - echo "$output" |
42 | | - exit 1 |
43 | | - fi |
44 | | -
|
45 | | - - name: Check compatibility with 0.7.6 |
46 | | - if: always() |
47 | | - run: | |
48 | | - output=$(forge build --skip test --use solc:0.7.6) |
49 | | - if echo "$output" | grep -q "Warning"; then |
50 | | - echo "$output" |
51 | | - exit 1 |
52 | | - fi |
53 | | -
|
54 | | - - name: Check compatibility with 0.7.0 |
55 | | - if: always() |
56 | | - run: | |
57 | | - output=$(forge build --skip test --use solc:0.7.0) |
58 | | - if echo "$output" | grep -q "Warning"; then |
59 | | - echo "$output" |
60 | | - exit 1 |
61 | | - fi |
62 | | -
|
63 | | - - name: Check compatibility with 0.6.12 |
64 | | - if: always() |
65 | | - run: | |
66 | | - output=$(forge build --skip test --use solc:0.6.12) |
67 | | - if echo "$output" | grep -q "Warning"; then |
68 | | - echo "$output" |
69 | | - exit 1 |
70 | | - fi |
71 | | -
|
72 | | - - name: Check compatibility with 0.6.2 |
73 | | - if: always() |
74 | | - run: | |
75 | | - output=$(forge build --skip test --use solc:0.6.2) |
76 | | - if echo "$output" | grep -q "Warning"; then |
77 | | - echo "$output" |
78 | | - exit 1 |
79 | | - fi |
80 | | -
|
| 31 | + - uses: foundry-rs/foundry-toolchain@v1 |
| 32 | + - run: forge --version |
| 33 | + - run: forge build --skip test --deny-warnings ${{ matrix.flags }} |
81 | 34 | # via-ir compilation time checks. |
82 | | - - name: Measure compilation time of Test with 0.8.17 --via-ir |
83 | | - if: always() |
84 | | - run: forge build --skip test --contracts test/compilation/CompilationTest.sol --use solc:0.8.17 --via-ir |
85 | | - |
86 | | - - name: Measure compilation time of TestBase with 0.8.17 --via-ir |
87 | | - if: always() |
88 | | - run: forge build --skip test --contracts test/compilation/CompilationTestBase.sol --use solc:0.8.17 --via-ir |
89 | | - |
90 | | - - name: Measure compilation time of Script with 0.8.17 --via-ir |
91 | | - if: always() |
92 | | - run: forge build --skip test --contracts test/compilation/CompilationScript.sol --use solc:0.8.17 --via-ir |
93 | | - |
94 | | - - name: Measure compilation time of ScriptBase with 0.8.17 --via-ir |
95 | | - if: always() |
96 | | - run: forge build --skip test --contracts test/compilation/CompilationScriptBase.sol --use solc:0.8.17 --via-ir |
| 35 | + - if: contains(matrix.flags, '--via-ir') |
| 36 | + run: forge build --skip test --deny-warnings ${{ matrix.flags }} --contracts 'test/compilation/*' |
97 | 37 |
|
98 | 38 | test: |
99 | 39 | runs-on: ubuntu-latest |
| 40 | + timeout-minutes: 10 |
| 41 | + strategy: |
| 42 | + fail-fast: false |
| 43 | + matrix: |
| 44 | + toolchain: [stable, nightly] |
100 | 45 | steps: |
101 | 46 | - uses: actions/checkout@v4 |
102 | | - |
103 | | - - name: Install Foundry |
104 | | - uses: foundry-rs/foundry-toolchain@v1 |
| 47 | + - uses: foundry-rs/foundry-toolchain@v1 |
105 | 48 | with: |
106 | | - version: nightly |
107 | | - |
108 | | - - name: Print forge version |
109 | | - run: forge --version |
110 | | - |
111 | | - - name: Run tests |
112 | | - run: forge test -vvv |
| 49 | + version: ${{ matrix.toolchain }} |
| 50 | + - run: forge --version |
| 51 | + - run: forge test -vvv |
113 | 52 |
|
114 | 53 | fmt: |
115 | 54 | runs-on: ubuntu-latest |
| 55 | + timeout-minutes: 10 |
116 | 56 | steps: |
117 | 57 | - uses: actions/checkout@v4 |
| 58 | + - uses: foundry-rs/foundry-toolchain@v1 |
| 59 | + - run: forge --version |
| 60 | + - run: forge fmt --check |
118 | 61 |
|
119 | | - - name: Install Foundry |
120 | | - uses: foundry-rs/foundry-toolchain@v1 |
121 | | - with: |
122 | | - version: nightly |
123 | | - |
124 | | - - name: Print forge version |
125 | | - run: forge --version |
| 62 | + typos: |
| 63 | + runs-on: ubuntu-latest |
| 64 | + timeout-minutes: 10 |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v4 |
| 67 | + - uses: crate-ci/typos@v1 |
126 | 68 |
|
127 | | - - name: Check formatting |
128 | | - run: forge fmt --check |
| 69 | + ci-success: |
| 70 | + runs-on: ubuntu-latest |
| 71 | + if: always() |
| 72 | + needs: |
| 73 | + - build |
| 74 | + - test |
| 75 | + - fmt |
| 76 | + - typos |
| 77 | + timeout-minutes: 10 |
| 78 | + steps: |
| 79 | + - name: Decide whether the needed jobs succeeded or failed |
| 80 | + uses: re-actors/alls-green@release/v1 |
| 81 | + with: |
| 82 | + jobs: ${{ toJSON(needs) }} |
0 commit comments