Skip to content

Commit

Permalink
ci: split release workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeVanti committed Oct 18, 2024
1 parent 765da02 commit 2e6a528
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 82 deletions.
82 changes: 0 additions & 82 deletions .github/workflows/ci.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on: push

jobs:
unit-test:
uses: ./.github/workflows/test-unit.yml
integration-test:
uses: ./.github/workflows/test-integration.yml
e2e-test:
uses: ./.github/workflows/test-e2e.yml
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 }}
27 changes: 27 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: E2E test
on: workflow_call
jobs:
e2e-test:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os:
- ubuntu
- windows
node:
- "18.x" # Oldest supported lts
- "20.x" # Newest lts
- "22.x" # Latest
name: E2E Tests
steps:
- uses: actions/checkout@v4
- name: setup node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: install deps
run: npm ci
- name: build
run: npm run build
- name: run tests
run: npm run test:e2e
18 changes: 18 additions & 0 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

name: Integration test
on: workflow_call
jobs:
integration-test:
runs-on: ubuntu-latest
name: Integration Tests
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test:integration
16 changes: 16 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Unit test
on: workflow_call
jobs:
unit-test:
runs-on: ubuntu-latest
name: Unit Tests
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
- name: npm ci
run: npm ci
- name: Unit tests
run: npm run test:unit

0 comments on commit 2e6a528

Please sign in to comment.