-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
598 additions
and
431 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ name: Checks | |
on: | ||
pull_request: | ||
branches: ["**"] | ||
push: | ||
branches: ["main"] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
@@ -15,19 +13,14 @@ jobs: | |
name: Python | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
- name: Install Poetry Action | ||
uses: snok/[email protected] | ||
- name: Set up Python 3.10 | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.10" | ||
- name: Install Poetry Action | ||
uses: snok/[email protected] | ||
- name: Set up Virtualenv Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: .venv | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | ||
restore-keys: ${{ runner.os }}-poetry- | ||
cache: "poetry" | ||
- name: Install Python Dependencies | ||
run: | | ||
poetry check --lock | ||
|
@@ -36,73 +29,41 @@ jobs: | |
run: | | ||
poetry run ruff format . --check | ||
poetry run ruff check . | ||
- name: Set up mypy cache | ||
uses: actions/[email protected] | ||
with: | ||
path: .mypy_cache | ||
key: ${{ runner.os }}-mypy-${{ hashFiles('glueetl/**/*.py') }} | ||
restore-keys: ${{ runner.os }}-mypy- | ||
- name: Check type annotations using mypy | ||
run: poetry run mypy | ||
- name: Check if requirements are up-to-date | ||
- name: Check imports using import-linter | ||
run: poetry run lint-imports | ||
- name: Check if requirements.txt is in sync with poetry.lock | ||
run: poetry export --with=dev --output docker/requirements.txt && git diff --exit-code | ||
- name: Set up pre-commit cache | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
restore-keys: ${{ runner.os }}-pre-commit- | ||
- name: Run pre-commit hooks | ||
run: | | ||
cp docker/.env.sample docker/.env | ||
poetry run pre-commit run --all-files | ||
env: | ||
# Skip redundant hooks that are already covered elsewhere in | ||
# this Github workflow | ||
SKIP: poetry-check,poetry-lock,poetry-install,lint-python,format-python,typecheck-python,update-requirements,hadolint-docker,shellcheck,checkmake | ||
- name: Set up NodeJS | ||
uses: actions/[email protected] | ||
with: | ||
node-version: "20" | ||
- name: Install NodeJS Dependencies | ||
run: npm install -g aws-cdk | ||
- name: Synthesize CDK deployment package | ||
run: cdk synth --strict | ||
run: npx aws-cdk synth --strict | ||
tests: | ||
name: Run tests in Glue container | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Run the checks inside Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: amazon/aws-glue-libs:glue_libs_4.0.0_image_01 | ||
options: --volume ${{ github.workspace }}:/home/glue_user/workspace --env AWS_REGION=us-east-1 | ||
run: | | ||
pip3 install --no-warn-script-location --user --upgrade pip==24.0 | ||
pip3 install --no-warn-script-location --user -r docker/requirements.txt | ||
python3 -m pytest -p no:cacheprovider | ||
pip-audit: | ||
name: Audit requirements | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Audit requirements using pip-audit | ||
uses: pypa/[email protected] | ||
with: | ||
inputs: docker/requirements.txt | ||
- uses: actions/[email protected] | ||
- name: Pull official glue image | ||
run: docker pull amazon/aws-glue-libs:glue_libs_4.0.0_image_01 | ||
- name: Build container | ||
run: USER_ID=$(id -u) docker compose --file docker/docker-compose.yml build glue | ||
- name: Run tests in container | ||
run: USER_ID=$(id -u) docker compose --file docker/docker-compose.yml run glue -c pytest | ||
shell: | ||
name: Shell | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected].4 | ||
- uses: actions/[email protected].7 | ||
- name: Check shell scripts using shellcheck | ||
uses: ludeeus/[email protected] | ||
dockerfile: | ||
name: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected].4 | ||
- uses: actions/[email protected].7 | ||
- name: Validate Dockerfile using hadolint | ||
uses: hadolint/[email protected] | ||
with: | ||
|
@@ -111,6 +72,6 @@ jobs: | |
name: Makefile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected].4 | ||
- uses: actions/[email protected].7 | ||
- name: Check Makefile using checkmake | ||
uses: Uno-Takashi/checkmake-action@v2 |
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
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
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
Oops, something went wrong.