From 76a4a086acadf910bbe08252b5842c016ff1c4fe Mon Sep 17 00:00:00 2001 From: Ryuu Mitsuki Date: Mon, 15 Apr 2024 00:47:55 +0700 Subject: [PATCH] ci(test): Add test CI workflow --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cc1aee6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Test + +on: + push: + branches: [ "master" ] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-ver: [16.x, 18.x, 20.x] + + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js v${{ matrix.node-ver }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-ver }} + cache: 'npm' + - name: Clean install the project + run: npm ci + - name: Build the project + run: npm run build --if-present + - name: Test the project + run: npm test