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

refactor: initial refactor #1

Merged
merged 11 commits into from
Oct 24, 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
69 changes: 0 additions & 69 deletions .github/workflows/cache.yaml

This file was deleted.

40 changes: 2 additions & 38 deletions .github/workflows/lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.12"]
include:
- os: ubuntu
image: ubuntu-latest
Expand All @@ -28,44 +28,8 @@ jobs:
- name: Check version info
run: pwd && docker compose --version && docker --version

# Provide a builder instance with docker buildx.
- name: Set up Docker Buildx
if: env.USE_CACHE == 'true'
uses: docker/setup-buildx-action@v3

# Specify a cache directory for build cache, and reuse past build cache as long as there are no changes to the environment files.
- name: Cache Docker layers
if: env.USE_CACHE == 'true'
id: build-cache
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache/${{ matrix.python-version }}
key: buildx-${{ hashFiles(format('{0}/Dockerfile', env.DOCKER_FILE_DIRECTORY), format('{0}/docker-compose.yaml', env.DOCKER_COMPOSE_DIRECTORY), 'poetry.lock') }}

# If build cache is found, use it to build the Docker image.
# The build is carried out using the `bake` command from buildx, referencing the `docker-compose.yaml` for CI.
- name: Build docker image with cache using buildx
if: steps.build-cache.outputs.cache-hit == 'true' && env.USE_CACHE == 'true'
uses: docker/bake-action@v4
with:
files: docker-compose.yaml
workdir: ${{ env.DOCKER_COMPOSE_DIRECTORY }}
load: true
set: |
core.args.PYTHON_VERSION=${{ matrix.python-version }}
*.cache-from=type=local,src=/tmp/.buildx-cache/${{ matrix.python-version }}

# If build cache is not found, build the Docker image without cache.
# It also works with docker/bake-action, but the `bake` command creates `/tmp/.buildx-cache/${{ matrix.python-version }}` as specified in cache-from.
# Since it is a cache directory tracked by actions/cache, if the directory exists at the end of the workflow, unnecessary cache is created in the merge branch.
# We used the regular build command to avoid this problem.
- name: Build docker image without cache using normal build
if: steps.build-cache.outputs.cache-hit != 'true' || env.USE_CACHE != 'true'
run: docker compose build --parallel --build-arg PYTHON_VERSION=${{ matrix.python-version }} core
working-directory: ${{ env.DOCKER_COMPOSE_DIRECTORY }}

- name: Create and start docker container
run: docker compose up --no-build -d
run: docker compose up -d
working-directory: ${{ env.DOCKER_COMPOSE_DIRECTORY }}

# pytest-cov export coverage data to a file
Expand Down
15 changes: 0 additions & 15 deletions CITATION.cff

This file was deleted.

Loading