Skip to content

Commit

Permalink
use reusable jobs in main ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ZibanPirate committed Sep 14, 2024
1 parent 8e84f1a commit f3aba19
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 49 deletions.
82 changes: 33 additions & 49 deletions .github/workflows/ci.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,36 @@ on:
- main

jobs:
install-build-lint-test-coverage-misc:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node-version: [20.x]
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false

steps:
- name: "Git"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Nodejs"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: "Install"
shell: bash
run: |
npm ci
- name: "Build"
shell: bash
run: |
npm run build
- name: "Lint"
shell: bash
run: |
npm run lint:alone
- name: "Test"
shell: bash
run: |
npm run test:alone -- -- --coverage
- name: "Misc"
shell: bash
run: |
npx lerna run bundle:alone --scope @dzcode.io/web
npx lerna run generate:sitemap --scope @dzcode.io/web
npx lerna run generate:htmls --scope @dzcode.io/web
env:
CI: true
build:
uses: ./.github/workflows/reusable/ci.build.yml
with:
node-version: "20"
os: "ubuntu-latest"

test-coverage:
needs: build
uses: ./.github/workflows/reusable/ci.test-coverage.yml
with:
node-version: "20"
os: "ubuntu-latest"

lint:
needs: build
uses: ./.github/workflows/reusable/ci.lint.yml
with:
node-version: "20"
os: "ubuntu-latest"

misc:
needs: build
uses: ./.github/workflows/reusable/ci.misc.yml
with:
node-version: "20"
os: "ubuntu-latest"

test-e2e:
needs: build
uses: ./.github/workflows/reusable/ci.test-e2e.yml
with:
node-version: "20"
os: "ubuntu-latest"
1 change: 1 addition & 0 deletions .github/workflows/reusable/ci.misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ jobs:
name: build output
- run: npx lerna run bundle:alone --scope @dzcode.io/web
- run: npx lerna run generate:sitemap --scope @dzcode.io/web
- run: npx lerna run generate:htmls --scope @dzcode.io/web

0 comments on commit f3aba19

Please sign in to comment.