From fa3487e5a4ee91ee702215510d00376a245407db Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 26 Sep 2023 22:47:07 +0100 Subject: [PATCH] chore: add test github workflow --- .github/workflows/release.yml | 11 ++++++---- .github/workflows/test.yml | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7c9c71b..670d4c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,23 +10,26 @@ jobs: release: name: Release runs-on: ubuntu-latest + strategy: + matrix: + deno: ["1.x"] + node: ["18"] steps: - name: Checkout Repo uses: actions/checkout@v3 - uses: denoland/setup-deno@v1 with: - deno-version: v1.36.x + deno-version: ${{ matrix.deno }} - name: Get tag version if: startsWith(github.ref, 'refs/tags/') id: get_tag_version run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT - uses: actions/setup-node@v3 with: - node-version: "18.x" - registry-url: "https://registry.npmjs.org" + node-version: ${{ matrix.node }} - uses: pnpm/action-setup@v2 with: - version: 8 + version: latest - name: npm build run: deno task npm ${{steps.get_tag_version.outputs.TAG_VERSION}} - name: npm publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b0607e6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +name: test +on: + push: + pull_request: + +jobs: + test-deno: + runs-on: ubuntu-latest + strategy: + matrix: + deno: ["1.x"] + name: Test Deno on Version ${{ matrix.deno }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - uses: denoland/setup-deno@v1 + with: + deno-version: ${{ matrix.deno }} + - name: Run tests in Deno + run: deno test -A + test-node: + runs-on: ubuntu-latest + strategy: + matrix: + deno: ["1.x"] + node: ["18", "20"] + name: Test Node on Version ${{ matrix.node }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - uses: denoland/setup-deno@v1 + with: + deno-version: ${{ matrix.deno }} + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - uses: pnpm/action-setup@v2 + with: + version: latest + - name: Build and test node + run: deno task npm 0.0.0 \ No newline at end of file