chore(ci): matrix test against node 22, 24 #595
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: Lint and test | |
| on: push | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: yarn | |
| - run: yarn | |
| - run: yarn lint | |
| test: | |
| strategy: | |
| matrix: | |
| node-version: [18, 20, 21, 22, 24] | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| mongodb: | |
| image: mongo | |
| ports: | |
| - 27017:27017 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{matrix.node-version}} | |
| cache: yarn | |
| - run: yarn | |
| - run: node test/smoketest.mjs | |
| - run: yarn test | |
| env: | |
| POSTGRES_URL: postgres://postgres:postgres@localhost:5432 | |
| MONGODB_URI: mongodb://localhost:27017 | |
| windows-test: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: yarn | |
| - run: yarn | |
| - run: yarn prepack | |
| - run: yarn test || yarn jest --no-silent --verbose --onlyFailures | |
| - run: node test/smoketest.mjs | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| if: github.ref_name == 'main' | |
| needs: [lint, test, windows-test] | |
| steps: | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.RELEASE_BOT_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.app-token.outputs.token }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| cache: yarn | |
| - run: yarn | |
| - run: yarn semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |