Force breeding sites tags to not hyphens #458
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: CI | |
# Enable Buildkit and let compose use it to speed up image building | |
env: | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
on: | |
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows | |
workflow_call: | |
pull_request: | |
push: | |
branches: ["master"] | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test application | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code Repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
# Same as Dockerfile service image name. | |
tags: mosquito_alert_v1_local | |
push: false | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run DB Migrations | |
run: docker compose -f docker-compose-local.yml run --rm django python3 manage.py migrate | |
- name: Run Django Tests | |
# Need to run as root because we are writing the results into the shared volume. | |
run: docker compose -f docker-compose-local.yml run -u root --rm django coverage run -m pytest | |
- name: Create coverage XML report | |
# Need to run as root because we are writing the results into the shared volume. | |
run: docker compose -f docker-compose-local.yml run -u root --rm django coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true | |
- name: Tear down the Stack | |
run: docker compose -f docker-compose-local.yml down |