Skip to content

feat: rework of the current POC #3

feat: rework of the current POC

feat: rework of the current POC #3

Workflow file for this run

name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y pip
pip install pre-commit
- name: Cache precommit linters
id: cache-precommit-linters
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
~/.cache/pre-commit/
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install linters
run: |
pre-commit install --install-hooks
- name: Run linters
run: |
pre-commit run --show-diff-on-failure --color=always --all-files
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: Running Tests
run: |
go mod tidy
make test
commitlint:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
env:
COMMITLINT_VERSION: "20.5.0"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Cache commitlint
id: cache-commitlint
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
node_modules
package.json
package-lock.json
key: ${{ runner.os }}-commitlint-${{ env.COMMITLINT_VERSION }}
- name: Install commitlint
if: steps.cache-commitlint.outputs.cache-hit != 'true'
run: npm install -D @commitlint/cli@${{ env.COMMITLINT_VERSION }} @commitlint/config-conventional@${{ env.COMMITLINT_VERSION }}
- name: Print versions
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose