diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da5282541..8b563a81e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,81 +1,75 @@ name: safe-contracts -on: [ push, pull_request ] +on: [push, pull_request] jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16.7.0 - - uses: actions/cache@v2 - with: - path: "**/node_modules" - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - run: yarn --frozen-lockfile - - run: yarn build - - run: yarn coverage - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16.7.0 - - uses: actions/cache@v2 - with: - path: "**/node_modules" - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - run: yarn --frozen-lockfile - - run: yarn lint:sol - tests-other: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - contract-name: ["SafeL2"] - env: - SAFE_CONTRACT_UNDER_TEST: ${{ matrix.contract-name }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16.7.0 - - uses: actions/cache@v2 - with: - path: "**/node_modules" - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - run: yarn --frozen-lockfile - - run: yarn build - - run: yarn coverage - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - benchmarks: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - solidity: ["0.7.6", "0.8.2"] - include: - - solidity: "0.8.2" - settings: '{"viaIR":true,"optimizer":{"enabled":true,"runs":10000}}' - env: - SOLIDITY_VERSION: ${{ matrix.solidity }} - SOLIDITY_SETTINGS: ${{ matrix.settings }} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16.7.0 - - uses: actions/cache@v2 - with: - path: "**/node_modules" - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - run: (yarn --frozen-lockfile && yarn build && yarn hardhat codesize --contractname Safe && yarn benchmark) || echo "Benchmark failed" + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + contract-name: ["Safe", "SafeL2"] + env: + SAFE_CONTRACT_UNDER_TEST: ${{ matrix.contract-name }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "yarn" + - run: yarn --frozen-lockfile + - run: yarn build + - run: yarn coverage + - name: Send coverage to Coveralls (parallel) + uses: coverallsapp/github-action@v2 + with: + parallel: true + flag-name: run-$ + github-token: ${{ secrets.GITHUB_TOKEN }} + + finish: + runs-on: ubuntu-latest + needs: tests + if: ${{ always() }} + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true + carryforward: "run-Safe,run-SafeL2" + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.7.0 + - uses: actions/cache@v2 + with: + path: "**/node_modules" + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - run: yarn --frozen-lockfile + - run: yarn lint:sol + + benchmarks: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + solidity: ["0.7.6", "0.8.2"] + include: + - solidity: "0.8.2" + settings: '{"viaIR":true,"optimizer":{"enabled":true,"runs":10000}}' + env: + SOLIDITY_VERSION: ${{ matrix.solidity }} + SOLIDITY_SETTINGS: ${{ matrix.settings }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.7.0 + - uses: actions/cache@v2 + with: + path: "**/node_modules" + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - run: (yarn --frozen-lockfile && yarn build && yarn hardhat codesize --contractname Safe && yarn benchmark) || echo "Benchmark failed"