Skip to content

fix: Coverage config for source #124

fix: Coverage config for source

fix: Coverage config for source #124

Workflow file for this run

name: Continuous Integration
on:
pull_request:
branches: ['**']
push:
branches: ['main']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
checks:
name: Check for code errors
runs-on: ubuntu-latest
strategy:
matrix:
# Glue Pythonshell supports only Python 3.9.
# Glue ETL supports only Python 3.10.
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v4.1.5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry Action
uses: snok/install-poetry@v1.3.4
- name: Set up Virtualenv Cache
uses: actions/cache@v4.0.2
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-
- name: Install Python Dependencies
run: |
poetry check --lock
poetry install
- name: Lint code using ruff
run: |
poetry run ruff format . --check
poetry run ruff check .
- name: Check type annotations using mypy
run: MYPYPATH=src poetry run mypy .
- name: Check imports between modules
run: poetry run lint-imports
- name: Check if requirements.txt is up-to-date
run: poetry export --with=dev --output docker/requirements.txt && git diff --exit-code
- name: Build python packages
run: poetry build
tests:
name: Run tests in Glue container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.5
- name: Build container and run tests
run: USER_ID=$(id -u) docker compose --file docker/docker-compose.yml run --rm --remove-orphans --build glue-utils -c pytest
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
pip-audit:
name: Audit requirements
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.5
- name: Audit requirements using pip-audit
uses: pypa/gh-action-pip-audit@v1.0.8
with:
inputs: docker/requirements.txt
dockerfile:
name: Check Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.5
- name: Validate Dockerfile using hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: docker/Dockerfile
checkmake:
name: Check Makefile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.5
- name: Check Makefile for errors
uses: Uno-Takashi/checkmake-action@main