| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | pull_request: |
| 6 | push: |
| 7 | branches: |
| 8 | - master |
| 9 | |
| 10 | jobs: |
| 11 | build: |
| 12 | runs-on: ubuntu-latest |
| 13 | steps: |
| 14 | - 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 | |
| 81 | # 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 |
| 97 | |
| 98 | test: |
| 99 | runs-on: ubuntu-latest |
| 100 | steps: |
| 101 | - uses: actions/checkout@v4 |
| 102 | |
| 103 | - name: Install Foundry |
| 104 | uses: foundry-rs/foundry-toolchain@v1 |
| 105 | with: |
| 106 | version: nightly |
| 107 | |
| 108 | - name: Print forge version |
| 109 | run: forge --version |
| 110 | |
| 111 | - name: Run tests |
| 112 | run: forge test -vvv |
| 113 | |
| 114 | fmt: |
| 115 | runs-on: ubuntu-latest |
| 116 | steps: |
| 117 | - uses: actions/checkout@v4 |
| 118 | |
| 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 |
| 126 | |
| 127 | - name: Check formatting |
| 128 | run: forge fmt --check |