Skip to content

Commit

Permalink
ci(workflows): [ci] add commitlint job
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Mar 3, 2023
1 parent d139c70 commit a31805b
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HUSKY: 0
REF: ${{ github.head_ref || github.ref_name }}
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -82,9 +83,35 @@ jobs:
- id: version-typescript
name: Get TypeScript version
run: echo "result=$(jq .devDependencies.typescript package.json -r)" >> $GITHUB_OUTPUT
gitguardian:
commitlint:
needs: metadata
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout ${{ env.REF }}
uses: actions/[email protected]
with:
fetch-depth: 0
ref: ${{ env.REF }}
- id: node
name: Setup Node.js
uses: actions/[email protected]
with:
cache: yarn
cache-dependency-path: yarn.lock
node-version-file: .nvmrc
- id: cache
name: Restore dependencies cache
uses: actions/[email protected]
with:
key: ${{ runner.os }}-${{ github.run_id }}
path: ${{ env.CACHE_PATH }}
- id: lint
name: Check commitlint status
run: yarn commitlint --from $SHA~${{ github.event.pull_request.commits || 1 }} --to $SHA
gitguardian:
needs: commitlint
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout ${{ env.REF }}
Expand All @@ -104,7 +131,9 @@ jobs:
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
format:
needs: gitguardian
needs:
- commitlint
- gitguardian
runs-on: ubuntu-latest
steps:
- id: checkout
Expand All @@ -129,7 +158,9 @@ jobs:
name: Check code formatting
run: yarn check:format
lint:
needs: gitguardian
needs:
- commitlint
- gitguardian
runs-on: ubuntu-latest
steps:
- id: checkout
Expand All @@ -154,7 +185,9 @@ jobs:
name: Check lint status
run: yarn check:lint
spelling:
needs: gitguardian
needs:
- commitlint
- gitguardian
runs-on: ubuntu-latest
steps:
- id: checkout
Expand All @@ -180,6 +213,7 @@ jobs:
run: yarn check:spelling
typescript:
needs:
- commitlint
- gitguardian
- metadata
runs-on: ubuntu-latest
Expand Down Expand Up @@ -224,7 +258,9 @@ jobs:
name: Run typecheck
run: yarn typecheck
test:
needs: gitguardian
needs:
- commitlint
- gitguardian
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -266,18 +302,19 @@ jobs:
flags: ${{ format('node{0}', matrix.node-version) }}
override_branch: ${{ env.REF }}
override_build: ${{ github.run_id }}
override_commit: ${{ env.GITHUB_SHA }}
override_commit: ${{ env.SHA }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
env:
GITHUB_JOB: ${{ github.job }}
GITHUB_REF: ${{ github.ref }}
GITHUB_REF_TYPE: ${{ github.ref_type }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
GITHUB_SHA: ${{ env.SHA }}
GITHUB_WORKSPACE: ${{ github.workspace }}
build:
needs:
- commitlint
- gitguardian
- metadata
runs-on: ubuntu-latest
Expand Down

0 comments on commit a31805b

Please sign in to comment.