Skip to content

Commit

Permalink
ci: update commit checking workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay authored Apr 27, 2022
1 parent 6e56d26 commit e77df18
Show file tree
Hide file tree
Showing 6 changed files with 512 additions and 49 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/dhis2-verify-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'dhis2: verify (commits)'

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
lint-pr-title:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: JulienKode/[email protected]
with:
configuration-path: ${{ steps.commitlint.outputs.config_path }}

lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: wagoid/commitlint-github-action@v4
with:
configFile: ${{ steps.commitlint.outputs.config_path }}
16 changes: 3 additions & 13 deletions .github/workflows/verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ jobs:
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
with:
configFile: commitlint.config.js

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -83,7 +73,7 @@ jobs:
- name: Flow
run: yarn flow:check

unit-tests:
unit-tests:
runs-on: ubuntu-latest
needs: install
if: "!contains(github.event.head_commit.message, '[skip ci]')"
Expand Down Expand Up @@ -117,7 +107,7 @@ jobs:
containers: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v1
with:
node-version: 14.x

Expand Down Expand Up @@ -206,4 +196,4 @@ jobs:
node-version: 14.x

- name: Publish release to GitHub
run: npx @dhis2/cli-utils release
run: npx @dhis2/cli-utils release
15 changes: 0 additions & 15 deletions .github/workflows/verify-pr-title.yml

This file was deleted.

3 changes: 0 additions & 3 deletions commitlint.config.js

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"@babel/preset-react": "^7.16.7",
"@dhis2/cli-app-scripts": "^8.3.3",
"@dhis2/cli-helpers-engine": "^3.2.1",
"@dhis2/cli-style": "^10.4.1",
"@dhis2/cli-utils-cypress": "^9.0.2",
"@dhis2/cypress-commands": "^8.0.6",
"@dhis2/cypress-plugins": "^9.0.2",
Expand Down
Loading

0 comments on commit e77df18

Please sign in to comment.