Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Run tests in container #10

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,52 @@ jobs:
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@v9

- 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 | git diff --exit-code
Container:
name: 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
run: |
pip3 install --user --upgrade pip==24.0
pip3 install --user -r requirements.txt
/home/glue_user/.local/bin/ruff format . --check --no-cache
/home/glue_user/.local/bin/ruff check . --no-cache
/home/glue_user/.local/bin/mypy
shell:
name: Shell
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Check shell scripts
uses: ludeeus/[email protected]
with:
Expand All @@ -64,7 +71,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Validate Dockerfile using hadolint
uses: hadolint/[email protected]

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM amazon/aws-glue-libs:glue_libs_4.0.0_image_01
ENV PLATFORM="docker"

# Arguments for passing the host user:group to the container.
ARG USER_ID
ARG USER_ID=1000

# Switch to root to be able to make changes in the container filesystem.
USER root
Expand Down