Skip to content

Tests: Inject add_pip handling in testing.helpers #4

Tests: Inject add_pip handling in testing.helpers

Tests: Inject add_pip handling in testing.helpers #4

Workflow file for this run

name: Images
on:
schedule:
- cron: '0 0 * * 0'
# NOTE: github.event context is pull_request payload:
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
pull_request:
paths:
- '.github/workflows/images.yml'
- 'Dockerfile'
- 'dev/linux/install_miniconda.sh'
- 'dev/linux/setup.sh'
- 'tests/requirements.txt'
# NOTE: github.event context is push payload:
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push
push:
paths:
- '.github/workflows/images.yml'
- 'Dockerfile'
- 'dev/linux/install_miniconda.sh'
- 'dev/linux/setup.sh'
- 'tests/requirements.txt'
# NOTE: github.event context is workflow_dispatch payload:
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch
workflow_dispatch:
concurrency:
# Concurrency group that uses the workflow name and PR number if available
# or commit SHA as a fallback. If a new build is triggered under that
# concurrency group while a previous build is running it will be canceled.
# Repeated pushes to a PR will cancel all previous builds, while multiple
# merges to main will not cancel.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-ci
jobs:
linux:
if: '!github.event.repository.fork'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: ${{ github.ref == 'refs/heads/main' }}
matrix:
python: ['3.8', '3.9', '3.10', '3.11']
channel: [defaults]
platforms: ['linux/amd64,linux/arm64,linux/ppc64le,linux/s390x']
include:
- python: '3.11' # same as miniforge
channel: conda-forge
platforms: 'linux/amd64,linux/arm64,linux/ppc64le'
steps:
- uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: ${{ matrix.platforms }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
driver-opts: network=host
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
suffix=-linux-python${{ matrix.python }}${{ matrix.channel == 'conda-forge' && '-conda-forge' || '' }}
- name: Build for ${{ matrix.channel }} & push Python ${{ matrix.python }}
uses: docker/build-push-action@v3
with:
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
build-args: |
python_version=${{ matrix.python }}
default_channel=${{ matrix.channel }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ matrix.platforms }}
push: ${{ github.ref == 'refs/heads/main' }}