Merge Request setup and test. #289
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: Test | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the develop branch | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| run-name: Merge Request setup and test. | |
| env: | |
| DENO_VERSION: "1.30.3" | |
| DENO_DIR: ~/.deno-cache | |
| jobs: | |
| node: | |
| name: Node/pnpm - setup and test | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| node_version: [18, 20, 22, latest] | |
| pnpm_version: [8.15.0, 9.4.0] | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Clone Repository | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{matrix.pnpm_version}} | |
| - name: Use Node.js ${{matrix.node_version}} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node_version }} | |
| cache: "pnpm" | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Run Tests | |
| run: pnpm run test | |
| - name: Report Coverage | |
| if: always() | |
| uses: davelosert/vitest-coverage-report-action@v2 | |
| bun: | |
| name: Bun setup and test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| bun_version: [1.0.0, 1.1.0, latest] | |
| steps: | |
| - name: Clone Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{matrix.bun_version}} | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run Tests | |
| run: bun run test | |
| # deno: | |
| # name: Deno setup and test | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Clone Repository | |
| # uses: actions/checkout@v3 | |
| # - name: Setup Deno | |
| # uses: denoland/setup-deno@v1 | |
| # with: | |
| # deno-version: ${{ env.DENO_VERSION }} | |
| # # Follows https://deno.land/manual@v1.30.1/advanced/continuous_integration#caching-dependencies | |
| # # but use the latest cache@v3 | |
| # - name: Cache Deno dependencies | |
| # uses: actions/cache@v3 | |
| # with: | |
| # path: ${{ env.DENO_DIR }} | |
| # key: ${{ hashFiles('deno.lock') }} | |
| # - name: Run Tests | |
| # run: deno test |