Skip to content

Commit

Permalink
refactor(ci): add shared prepare job
Browse files Browse the repository at this point in the history
  • Loading branch information
kareemmahlees committed Dec 10, 2023
1 parent 434b7dd commit f61d01e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Lint Commits & Code
on: [push, pull_request]

jobs:
commitlint:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -14,6 +14,10 @@ jobs:
node-version: "latest"
cache: "yarn"
cache-dependency-path: "yarn.lock"
commitlint:
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Install commitlint
run: |
yarn add conventional-changelog-conventionalcommits
Expand All @@ -25,16 +29,9 @@ jobs:
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
eslint:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "latest"
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: Install Deps
run: yarn add next eslint eslint-config-next
- name: Run Eslint
Expand Down

0 comments on commit f61d01e

Please sign in to comment.