Skip to content

Commit

Permalink
ci: extract test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeVanti committed Oct 18, 2024
1 parent 765da02 commit 7537623
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on: push

jobs:
test:
uses: ./.github/workflows/test.yml
release:
runs-on: ubuntu-latest
needs:
- 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 }}
34 changes: 4 additions & 30 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: CI

on: push

name: Run tests
on: workflow_call
jobs:
unit-test:
runs-on: ubuntu-latest
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 7537623

Please sign in to comment.