|
12 | 12 | pull_request: |
13 | 13 | schedule: |
14 | 14 | # run CI every day even if no PRs/merges occur |
15 | | - - cron: '0 12 * * *' |
| 15 | + - cron: "0 12 * * *" |
16 | 16 |
|
17 | 17 | jobs: |
18 | 18 | tests: |
|
45 | 45 | workdir: program-analysis/echidna/exercises/exercise4/ |
46 | 46 | files: solution.sol |
47 | 47 | config: config.yaml |
48 | | - contract: Token |
| 48 | + contract: TestToken |
49 | 49 | outcome: failure |
50 | 50 | expected: 'transfer(address,uint256):\s*failed' |
51 | 51 | - name: Exercise 5 |
|
83 | 83 | files: gas.sol |
84 | 84 | config: gas.yaml |
85 | 85 | outcome: success |
86 | | - expected: 'f(42,123,' |
| 86 | + expected: "f(42,123," |
87 | 87 | flaky: true |
88 | 88 | - name: Multi |
89 | 89 | workdir: program-analysis/echidna/example/ |
@@ -131,59 +131,59 @@ jobs: |
131 | 131 | expected: 'test_flag_is_false():\s*failed' |
132 | 132 |
|
133 | 133 | steps: |
134 | | - - name: Checkout repository |
135 | | - uses: actions/checkout@v3 |
| 134 | + - name: Checkout repository |
| 135 | + uses: actions/checkout@v3 |
136 | 136 |
|
137 | | - - name: Checkout Damn Vulnerable DeFi solutions |
138 | | - uses: actions/checkout@v3 |
139 | | - if: startsWith(matrix.workdir, 'dvdefi') |
140 | | - with: |
141 | | - repository: crytic/damn-vulnerable-defi-echidna |
142 | | - ref: solutions |
143 | | - path: ${{ matrix.workdir }} |
| 137 | + - name: Checkout Damn Vulnerable DeFi solutions |
| 138 | + uses: actions/checkout@v3 |
| 139 | + if: startsWith(matrix.workdir, 'dvdefi') |
| 140 | + with: |
| 141 | + repository: crytic/damn-vulnerable-defi-echidna |
| 142 | + ref: solutions |
| 143 | + path: ${{ matrix.workdir }} |
144 | 144 |
|
145 | | - - name: Set up Nodejs |
146 | | - uses: actions/setup-node@v3 |
147 | | - if: startsWith(matrix.workdir, 'dvdefi') |
148 | | - with: |
149 | | - node-version: 16 |
| 145 | + - name: Set up Nodejs |
| 146 | + uses: actions/setup-node@v3 |
| 147 | + if: startsWith(matrix.workdir, 'dvdefi') |
| 148 | + with: |
| 149 | + node-version: 16 |
150 | 150 |
|
151 | | - - name: Install dependencies and compile |
152 | | - if: startsWith(matrix.workdir, 'dvdefi') |
153 | | - run: | |
154 | | - yarn install --frozen-lockfile |
155 | | - npx hardhat compile --force |
156 | | - working-directory: ${{ matrix.workdir }} |
| 151 | + - name: Install dependencies and compile |
| 152 | + if: startsWith(matrix.workdir, 'dvdefi') |
| 153 | + run: | |
| 154 | + yarn install --frozen-lockfile |
| 155 | + npx hardhat compile --force |
| 156 | + working-directory: ${{ matrix.workdir }} |
157 | 157 |
|
158 | | - - name: Run Echidna |
159 | | - uses: crytic/echidna-action@v2 |
160 | | - id: echidna |
161 | | - continue-on-error: true |
162 | | - with: |
163 | | - files: ${{ matrix.files }} |
164 | | - contract: ${{ matrix.contract }} |
165 | | - config: ${{ matrix.config }} |
166 | | - output-file: ${{ matrix.files }}.out |
167 | | - solc-version: ${{ matrix.solc-version || '0.5.11' }} |
168 | | - echidna-workdir: ${{ matrix.workdir }} |
169 | | - echidna-version: edge |
170 | | - crytic-args: ${{ matrix.crytic-args || '' }} |
| 158 | + - name: Run Echidna |
| 159 | + uses: crytic/echidna-action@v2 |
| 160 | + id: echidna |
| 161 | + continue-on-error: true |
| 162 | + with: |
| 163 | + files: ${{ matrix.files }} |
| 164 | + contract: ${{ matrix.contract }} |
| 165 | + config: ${{ matrix.config }} |
| 166 | + output-file: ${{ matrix.files }}.out |
| 167 | + solc-version: ${{ matrix.solc-version || '0.5.11' }} |
| 168 | + echidna-workdir: ${{ matrix.workdir }} |
| 169 | + echidna-version: edge |
| 170 | + crytic-args: ${{ matrix.crytic-args || '' }} |
171 | 171 |
|
172 | | - - name: Verify that the exit code is correct |
173 | | - run: | |
174 | | - if [[ ${{ steps.echidna.outcome }} = ${{ matrix.outcome }} ]]; then |
175 | | - echo "Outcome matches" |
176 | | - else |
177 | | - echo "Outcome mismatch. Expected ${{ matrix.outcome }} but got ${{ steps.echidna.outcome }}" |
178 | | - exit 1 |
179 | | - fi |
| 172 | + - name: Verify that the exit code is correct |
| 173 | + run: | |
| 174 | + if [[ ${{ steps.echidna.outcome }} = ${{ matrix.outcome }} ]]; then |
| 175 | + echo "Outcome matches" |
| 176 | + else |
| 177 | + echo "Outcome mismatch. Expected ${{ matrix.outcome }} but got ${{ steps.echidna.outcome }}" |
| 178 | + exit 1 |
| 179 | + fi |
180 | 180 |
|
181 | | - - name: Verify that the output is correct |
182 | | - run: | |
183 | | - if grep -q "${{ matrix.expected }}" "${{ steps.echidna.outputs.output-file }}"; then |
184 | | - echo "Output matches" |
185 | | - else |
186 | | - echo "Output mismatch. Expected something matching '${{ matrix.expected }}'. Got the following:" |
187 | | - cat "${{ steps.echidna.outputs.output-file }}" |
188 | | - exit 1 |
189 | | - fi |
| 181 | + - name: Verify that the output is correct |
| 182 | + run: | |
| 183 | + if grep -q "${{ matrix.expected }}" "${{ steps.echidna.outputs.output-file }}"; then |
| 184 | + echo "Output matches" |
| 185 | + else |
| 186 | + echo "Output mismatch. Expected something matching '${{ matrix.expected }}'. Got the following:" |
| 187 | + cat "${{ steps.echidna.outputs.output-file }}" |
| 188 | + exit 1 |
| 189 | + fi |
0 commit comments