chore(ci): add commitlint step to checks

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): dereference git branches

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): debug git dir

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): fetch refs

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): fix commitlint

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): remove cat

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): git fetch all

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): ffs

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): ffs 2

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

chore(ci): fix commitlint step

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
Ricardo Arturo Cabral Mejía 2022-11-20 12:36:00 -05:00
parent ca1a808700
commit 205be2cf00

View File

@ -11,11 +11,28 @@ concurrency:
cancel-in-progress: true
jobs:
lint:
name: Lint
commit-lint:
name: Lint commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
@ -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
@ -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
@ -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
@ -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]
@ -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: