feat: add standard labels to chart resources to facilitate log querying #61
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: Test and Build Experiment Runner Image | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
env: | |
DOCKER_FILE: ./docker/bittorrent-benchmarks.Dockerfile | |
DOCKER_REPO: codexstorage/bittorrent-benchmarks | |
jobs: | |
test-and-build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Setup Docker Metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_REPO }} | |
flavor: | | |
latest=true | |
tags: | | |
type=sha | |
- name: Build Test Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ${{ env.DOCKER_FILE }} | |
push: false | |
load: true | |
tags: bittorrent-benchmarks:test | |
build-args: | | |
BUILD_TYPE=test | |
- name: Lint | |
run: | | |
docker run --rm --entrypoint poetry bittorrent-benchmarks:test run ruff check | |
- name: Type Check | |
run: | | |
docker run --rm --entrypoint poetry bittorrent-benchmarks:test run mypy . | |
- name: Run Unit Tests | |
run: | | |
docker run --rm --entrypoint poetry bittorrent-benchmarks:test run pytest -m "not integration" | |
- name: Run Integration Tests | |
run: | | |
docker compose -f docker-compose.local.yaml -f docker-compose.ci.yaml up --abort-on-container-exit --exit-code-from test-runner | |
- name: Build and Push Prod. Image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: ${{ env.DOCKER_FILE }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |