Skip to content

Resolwe CI

Resolwe CI #4071

Workflow file for this run

name: Resolwe CI
on:
push:
branches:
- master
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
pull_request:
schedule:
- cron: "30 2 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
test:
env:
RESOLWE_COMMUNICATOR_IMAGE: "resolwe/com:testing"
runs-on: arc-runner
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- toxenv: "py311"
description: "Unit tests (Python 3.11)"
- toxenv: "py312"
description: "Unit tests (Python 3.12)"
- toxenv: "linters"
description: "Linters (Python 3.12)"
- toxenv: "packaging"
description: "Packaging (Python 3.12)"
- toxenv: "migrations"
description: "Migrations (Python 3.12)"
name: ${{ matrix.description }}
services:
postgres:
image: public.ecr.aws/docker/library/postgres:16
ports:
- 55432:5432
env:
POSTGRES_USER: resolwe
POSTGRES_DB: resolwe
POSTGRES_PASSWORD: resolwe
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: public.ecr.aws/docker/library/redis:7-alpine
ports:
- 56379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build communication container
if: matrix.toxenv == 'py311' || matrix.toxenv == 'py312'
working-directory: ./resolwe/flow/docker_images
run: docker build -f Dockerfile.communication -t ${{ env.RESOLWE_COMMUNICATOR_IMAGE }} ../../
- name: ${{ matrix.description }}
env:
GITHUB_ACTIONS_DEBUG: ${{ runner.debug || false }}
run: |
tox -e ${{ matrix.toxenv }}
build:
runs-on: arc-runner
needs: test
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: Install build
run: python3.12 -m pip install --user build
- name: Build a binary wheel and a source tarball
run: python3.12 -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: .coverage
token: ${{ secrets.CODECOV_TOKEN }}