From 4cdb698afcc576cee8e3a8bc1a080a17e503f360 Mon Sep 17 00:00:00 2001 From: Ramon Brullo Date: Fri, 18 Oct 2024 11:19:08 +0200 Subject: [PATCH] ci: extract test workflow --- .github/workflows/release.yml | 28 ++++++++++++++++++++++ .github/workflows/{ci.yml => test.yml} | 32 +++----------------------- 2 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/release.yml rename .github/workflows/{ci.yml => test.yml} (64%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..4a96cf2d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release + +on: + workflow_run: + workflows: Run tests + branches: master + types: + - completed + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: npm install + run: npm install + - name: Build + run: npm run build + - name: Release + uses: cycjimmy/semantic-release-action@v3 + with: + extra_plugins: | + @semantic-release/changelog + @semantic-release/git + branch: master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 64% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index fe159bc8..0a1ddc62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,5 @@ -name: CI - +name: Run tests on: push - jobs: unit-test: runs-on: ubuntu-latest @@ -16,7 +14,7 @@ jobs: run: npm ci - name: Unit tests run: npm run test:unit - + integration-test: runs-on: ubuntu-latest name: Integration Tests @@ -55,28 +53,4 @@ jobs: - name: build run: npm run build - name: run tests - run: npm run test:e2e - - release: - runs-on: ubuntu-latest - needs: - - unit-test - - integration-test - - e2e-test - if: github.ref == 'refs/heads/master' - steps: - - uses: actions/checkout@v4 - - name: npm install - run: npm install - - name: Build - run: npm run build - - name: Release - uses: cycjimmy/semantic-release-action@v3 - with: - extra_plugins: | - @semantic-release/changelog - @semantic-release/git - branch: master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm run test:e2e \ No newline at end of file