Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 45 additions & 20 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,28 @@ concurrency:
cancel-in-progress: true

jobs:
commit-lint:
name: Lint commits
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
- name: Install package dependencies
run: npm ci
- name: Run commitlint
run: npx commitlint --from=origin/$GITHUB_BASE_REF
lint:
name: Lint
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
Expand All @@ -28,7 +45,8 @@ jobs:
name: Build check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
Expand All @@ -40,8 +58,13 @@ jobs:
test-units-and-cover:
name: Unit Tests And Coverage
runs-on: ubuntu-latest
needs:
- commit-lint
- lint
- build-check
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
Expand Down Expand Up @@ -70,11 +93,12 @@ jobs:
name: Integration Tests and Coverage
runs-on: ubuntu-latest
needs:
- commit-lint
- lint
- build-check
- test-units-and-cover
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
Expand Down Expand Up @@ -107,18 +131,19 @@ jobs:
needs: [test-units-and-cover, test-integrations-and-cover]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
name: Download unit & integration coverage reports
with:
path: .coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
name: Download unit & integration coverage reports
with:
path: .coverage
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
post-tests:
name: Post Tests
needs: [test-units-and-cover, test-integrations-and-cover]
Expand All @@ -133,14 +158,14 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
needs: [test-integrations-and-cover]
needs: [test-units-and-cover, test-integrations-and-cover]
if: github.ref == 'refs/heads/main'
environment: release
env:
TELEGRAM_BOT_ID: ${{ secrets.TELEGRAM_BOT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
npm run build:check
npm run test:unit
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
}
Loading