Skip to content

Add ECR Library sorting (#2812) #683

Add ECR Library sorting (#2812)

Add ECR Library sorting (#2812) #683

name: DIBBs Container Workflow
on:
pull_request:
branches:
- "**"
paths:
- containers/dibbs/**
merge_group:
types:
- checks_requested
push:
branches:
- main
paths-ignore:
- pyproject.toml
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
TEST_RUNNER_PYTHON_VERSION: 3.11
CONTAINER: dibbs
jobs:
python-linting:
uses: ./.github/workflows/linting-python.yaml
with:
python_runner_version: 3.11 # must be hardcoded; cannot pass in from env
unit-test-python-containers:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python ${{env.TEST_RUNNER_PYTHON_VERSION}}
uses: actions/setup-python@v5
with:
python-version: ${{env.TEST_RUNNER_PYTHON_VERSION}}
cache: pip
- name: Install pytest and pytest-cov
run: pip install pytest pytest-cov
- name: Install dependencies
working-directory: ./containers/${{env.CONTAINER}}
run: |
pip install .
pip install -r requirements.txt
if [ -f dev-requirements.txt ]; then
pip install -r dev-requirements.txt
fi
- name: Run unit tests for container with coverage
working-directory: ./containers/${{env.CONTAINER}}
run: |
python -m pytest --cov-report xml --cov=. -m "not integration" tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ env.CONTAINER }}
build-container:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build ${{ env.CONTAINER }} Container
uses: docker/build-push-action@v3
with:
context: ./containers/${{ env.CONTAINER }}
push: false
cache-from: type=gha
cache-to: type=gha,mode=max