Skip to content

Add a docker/dagger-based testing workflow, adopt PEP 517/621 #10

Add a docker/dagger-based testing workflow, adopt PEP 517/621

Add a docker/dagger-based testing workflow, adopt PEP 517/621 #10

Workflow file for this run

name: Dagger/Docker Testing Suite
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
image_tag:
description: 'Image tag to use for the Docker image'
required: true
default: 'latest'
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install pre-commit
pre-commit install
- name: Run pre-commit
run: |
pre-commit run --all-files --show-diff-on-failure
integration:
name: Integration Tests
needs: lint
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
if: github.event_name == 'workflow_dispatch'
with:
context: .
file: "Dockerfile"
build-args: |
BASE_IMAGE_TAG=${{ github.event.inputs.image_tag }}
tags: localpavics-sdi:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
- uses: docker/build-push-action@v4
if: github.event_name != 'workflow_dispatch'
with:
context: .
file: "Dockerfile"
tags: localpavics-sdi:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
- name: Dagger testing
run: |
pip install .[dagger]
python ./ci/dagger-pipeline.py