diff --git a/.github/workflows/protocol-contracts-staking-hardhat-tests.yml b/.github/workflows/protocol-contracts-staking-hardhat-tests.yml new file mode 100644 index 0000000000..dafdbcfd3d --- /dev/null +++ b/.github/workflows/protocol-contracts-staking-hardhat-tests.yml @@ -0,0 +1,61 @@ +# Run tests +name: protocol-contracts-staking-tests + +on: + pull_request: + + push: + branches: + - main + +permissions: {} + +concurrency: + group: ci-tests-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + check-changes: + name: protocol-contracts-staking-tests/check-changes + permissions: + actions: 'read' # Required to read workflow run information + contents: 'read' # Required to checkout repository code + pull-requests: 'read' # Required to read pull request information + runs-on: ubuntu-latest + outputs: + changes-protocol-contracts-staking: ${{ steps.filter.outputs.protocol-contracts-staking }} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: 'false' + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: filter + with: + filters: | + protocol-contracts-staking: + - .github/workflows/protocol-contracts-staking-tests.yml + - protocol-contracts/staking/** + tests: + name: protocol-contracts-staking-tests/tests (bpr) + needs: check-changes + if: ${{ needs.check-changes.outputs.changes-protocol-contracts-staking == 'true' }} + runs-on: ubuntu-latest + permissions: + contents: 'read' # Required to checkout repository code + steps: + - name: Checkout project + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: 'false' + + - name: Install dependencies + working-directory: protocol-contracts/staking + run: npm ci + + - name: Run unit tests + working-directory: protocol-contracts/staking + run: make test + + - name: Run tasks tests + working-directory: protocol-contracts/staking + run: make test-tasks