From e271bc61b630c88e498e545fc2274a91a951df4e Mon Sep 17 00:00:00 2001 From: Manish Chiniwalar <324068+manishrc@users.noreply.github.com.> Date: Mon, 6 May 2024 22:42:52 +0200 Subject: [PATCH] fix: only release/publish if tests are passing --- .github/workflows/publish.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 194df49..4f7b629 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,7 +6,26 @@ on: - "v*" jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + node: ["14.x", "16.x"] + steps: + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Install modules + run: npm install + - name: Run tests + run: npm run test release: + needs: test runs-on: ubuntu-latest steps: - name: Checkout code @@ -23,6 +42,7 @@ jobs: prerelease: false publish: + needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v2