Bump black from 23.11.0 to 24.3.0 #88
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/CD | |
on: [push] | |
jobs: | |
test: | |
name: Test and check quality | |
runs-on: ubuntu-latest | |
env: | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
DOCKER_BUILDKIT: 1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: ${{ runner.os }}-buildx- | |
- name: Build and run containers | |
run: docker-compose up -d --build --quiet-pull | |
- name: Check code formatting with Black | |
run: docker-compose exec -T web black --check . | |
- name: Lint code with Ruff | |
run: docker-compose exec -T web ruff check . | |
- name: Run tests | |
run: docker-compose exec -T -e DB_HOST=db web pytest -n auto --cov="." --cov-report=xml | |
- name: Send test results to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
- name: Clean up | |
run: docker-compose down -v | |
# # Disable CD since there is no hosting at the moment. | |
# build-and-deploy: | |
# name: Build Production Images and Deploy to Amazon ECR | |
# runs-on: ubuntu-latest | |
# needs: [test] | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# - name: Configure AWS credentials | |
# uses: aws-actions/configure-aws-credentials@v4 | |
# with: | |
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
# aws-region: eu-central-1 | |
# - name: Login to Amazon ECR | |
# id: login-ecr | |
# uses: aws-actions/amazon-ecr-login@v2 | |
# - name: Build, tag, and push images to Amazon ECR | |
# run: | | |
# touch .env.prod | |
# docker-compose -f docker-compose.prod.yml build | |
# docker-compose -f docker-compose.prod.yml push |