Skip to content

Commit

Permalink
feat: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Sep 24, 2024
1 parent a2dec38 commit 2efa1c7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 40 deletions.
46 changes: 18 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,73 +26,63 @@ jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest
name: "Build&Test: node-18, ubuntu-latest"
name: "Build&Test: node-lts, ubuntu-latest"

Check failure on line 29 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Lint: node-lts, ubuntu-latest

Strings must use singlequote
steps:
- name: ⤵️ Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Assume PRs are less than 50 commits
fetch-depth: 50

fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@57d9664f8e2aa45f26bcb59095f99aa47ae8e90d # v35.4.4
with:
files: |
docs/**
.github/**
.vscode/**
!.github/workflows/ci.yml
**.md
- name: 🎉 Install pnpm
if: steps.changed-files.outputs.only_changed != 'true'
uses: pnpm/action-setup@v2.2.4

- name: 🎉 Set node version to 18
uses: pnpm/action-setup@v4
- name: 🎉 Set node version to lts
if: steps.changed-files.outputs.only_changed != 'true'
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"

node-version: lts/*
registry-url: https://registry.npmjs.org/
cache: pnpm
- name: 🚧 Install deps
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm install

- name: 📦 Build
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run build

- name: 🔀 Test unit
if: steps.changed-files.outputs.only_changed != 'true'
run: pnpm run test

lint:
timeout-minutes: 10
runs-on: ubuntu-latest
name: "Lint: node-18, ubuntu-latest"
name: "Lint: node-lts, ubuntu-latest"

Check failure on line 68 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / Lint: node-lts, ubuntu-latest

Strings must use singlequote
steps:
- name: ⤵️ Checkout
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: 🎉 Install pnpm
uses: pnpm/action-setup@v2.2.4

- name: 🎉 Set node version to 18
uses: actions/setup-node@v3
uses: pnpm/action-setup@v4
- name: 🎉 Set node version to lts
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"

node-version: lts/*
registry-url: https://registry.npmjs.org/
cache: pnpm
- name: 🚧 Install deps
run: pnpm install

- name: 📦 Build
run: pnpm run build

- name: 🔀 Lint
run: pnpm run lint

# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
- name: 🔀 Check workflow files
run: |
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,21 @@ jobs:
environment: Release
steps:
- name: ⤵️ Checkout
uses: actions/checkout@v3

uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🎉 Install pnpm
uses: pnpm/action-setup@v2.2.4

- name: 🎉 Set node version to 16.x
uses: actions/setup-node@v3
uses: pnpm/action-setup@v4
- name: 🎉 Set node version to lts
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: lts/*
registry-url: https://registry.npmjs.org/
cache: "pnpm"

cache: pnpm
- name: 🚧 Install deps
run: pnpm install

- name: 📦 Build
run: pnpm run build

- name: 🔀 Publish package
run: npm publish --access public
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 🔀 Create Release for Tag
id: release_tag
uses: actions/create-release@v1
Expand Down

0 comments on commit 2efa1c7

Please sign in to comment.