Set up a minimal CI #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linters | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
lint-git: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' # Makes sense only for pull requests | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: show | |
run: git log | |
- name: Check absence of fixup commits | |
run: | | |
! git log | grep 'fixup!' | |
- name: Install gitlint | |
run: pip install --user requests gitlint | |
- name: Lint commit messages added to main | |
run: ~/.local/bin/gitlint --commits origin/${{ github.event.pull_request.base.ref }}..HEAD | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: yarn install | |
- name: Run linter over sources | |
run: yarn lint |