ci: Improvements to CI #9
Workflow file for this run
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: Checks | |
on: | |
pull_request: | |
branches: ['**'] | |
push: | |
branches: ['main'] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
python: | |
name: Python | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Setup Virtualenv Cache | |
uses: actions/[email protected] | |
with: | |
path: .venv | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Set up Python 3.10 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.10.13" | |
- name: Setup Poetry | |
uses: Gr1N/setup-poetry@v8 | |
- name: Install Python Dependencies | |
run: poetry install --no-root | |
- name: Check poetry config | |
run: poetry check | |
- name: Lint Python code | |
run: | | |
poetry run ruff format . --check | |
poetry run ruff check . | |
- name: Check type annotations | |
run: poetry run mypy | |
- name: Check if requirements.txt is up to date | |
run: poetry export --output requirements.txt | diff requirements.txt - | |
shell: | |
name: Shell | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Check shell scripts | |
uses: ludeeus/[email protected] | |
with: | |
scandir: '.' | |
dockerfile: | |
name: Dockerfile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Validate Dockerfile using hadolint | |
uses: hadolint/[email protected] | |