ci: migrate CI to GitHub Actions #37
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR test | |
| description: tests the PR | |
| on: [pull_request] | |
| concurrency: | |
| group: ${{ github.ref }}-pr-test | |
| cancel-in-progress: true | |
| jobs: | |
| check-code: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 18 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci && npm run codegen | |
| - name: Check format | |
| run: npm run check-format | |
| - name: Lint | |
| run: npm run lint | |
| test: | |
| uses: ./.github/workflows/reusable-test.yml | |
| with: | |
| node-version: '18' | |
| upload-coverage: true | |
| secrets: | |
| infura-project-id: ${{ secrets.INFURA_PROJECT_ID }} | |
| etherscan-api-key: ${{ secrets.ETHERSCAN_API_KEY }} | |
| alchemy-api-key: ${{ secrets.ALCHEMY_API_KEY }} | |
| sonar: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci && npm run codegen | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| artifact-ids: ${{ needs.test.outputs.coverage-artifact-id }} | |
| - name: SonarScanner | |
| uses: SonarSource/[email protected] | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
| npm-dry-run: | |
| uses: ./.github/workflows/reusable-npm.yml | |
| with: | |
| dry-run: true | |
| docker-dry-run: | |
| uses: ./.github/workflows/reusable-docker.yml | |
| with: | |
| dry-run: true |