test Bun support #230
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: ci | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| engine: | |
| - 28 | |
| - 27 | |
| - master | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node for Unit Tests | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.0.3 | |
| with: | |
| cache: npm | |
| node-version-file: .node-version | |
| - name: Install | |
| run: | | |
| npm install | |
| - name: Format Check | |
| run: | | |
| npm run format.check | |
| - name: Type Check | |
| run: | | |
| npm run typecheck | |
| - name: Set up Docker | |
| id: engine | |
| uses: docker/setup-docker-action@b60f85385d03ac8acfca6d9996982511d8620a19 #v4.3.0 | |
| with: | |
| version: type=image,version=${{ matrix.engine }} | |
| - name: Test (Node) | |
| run: | | |
| npm test | |
| env: | |
| DOCKER_HOST: ${{ steps.engine.outputs.sock }} | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Test (Bun) | |
| run: | | |
| bun i | |
| bun --bun test test/*.test.ts | |
| env: | |
| DOCKER_HOST: ${{ steps.engine.outputs.sock }} | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node for Build | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.0.3 | |
| with: | |
| cache: npm | |
| node-version-file: .node-version | |
| - name: Install | |
| run: | | |
| npm install | |
| - name: Build | |
| run: | | |
| npm run build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-output | |
| path: dist/ | |
| ci-integration: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: | |
| - 18 | |
| - 20 | |
| - 22 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-output | |
| path: dist | |
| - name: Set up Docker | |
| id: engine | |
| uses: docker/setup-docker-action@b60f85385d03ac8acfca6d9996982511d8620a19 #v4.3.0 | |
| with: | |
| version: type=image,version=28 | |
| - name: Setup Node v${{ matrix.node }} for Integration Tests | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 #v4.0.3 | |
| with: | |
| cache: npm | |
| node-version: ${{ matrix.node }} | |
| - name: Integration tests ESM | |
| working-directory: ./test-integration/esm-project | |
| run: | | |
| npm install --install-links | |
| npm run test | |
| env: | |
| DOCKER_HOST: ${{ steps.engine.outputs.sock }} | |
| - name: Integration tests CJS | |
| working-directory: ./test-integration/cjs-project | |
| run: | | |
| npm install --install-links | |
| npm run test | |
| env: | |
| DOCKER_HOST: ${{ steps.engine.outputs.sock }} |