Skip to content

Merge pull request #139 from kbase/dev-service #284

Merge pull request #139 from kbase/dev-service

Merge pull request #139 from kbase/dev-service #284

Workflow file for this run

name: KBase CDM Task Service tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop
jobs:
task_service_tests:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- python-version: "3.11"
minio: "2024-10-02T17-50-41Z" # minimum supported version
mc: "2024-08-13T05-33-17Z"
steps:
- name: Repo checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and set up test config
shell: bash
run: |
export CRANE_VER=v0.20.2
export HOMEDIR=`pwd`
# set up python dependencies
pip install pipenv
pipenv sync --system --dev
# move to parent dir of homedir to install binaries etc
cd ..
# set up crane
# don't bother to verify provenance here
curl -sL "https://github.com/google/go-containerregistry/releases/download/$CRANE_VER/go-containerregistry_Linux_x86_64.tar.gz" > go-containerregistry.tar.gz
tar -zxf go-containerregistry.tar.gz
export CRANE_EXE_PATH=`pwd`/crane
# set up Minio
wget -q https://dl.minio.io/server/minio/release/linux-amd64/archive/minio.RELEASE.${{matrix.minio}} -O minio
chmod a+x minio
export MINIOD=`pwd`/minio
wget -q https://dl.minio.io/client/mc/release/linux-amd64/archive/mc.RELEASE.${{matrix.mc}} -O mc
chmod a+x mc
export MINIO_MC=`pwd`/mc
# set up test config
cd $HOMEDIR
cp test.cfg.example test.cfg
sed -i "s#^test.crane.exe=.*#test.crane.exe=$CRANE_EXE_PATH#" test.cfg
sed -i "s#^test.minio.exe=.*#test.minio.exe=$MINIOD#" test.cfg
sed -i "s#^test.minio.mc.exe=.*#test.minio.mc.exe=$MINIO_MC#" test.cfg
cat test.cfg
- name: Run tests
shell: bash
run: PYTHONPATH=. pytest --cov=cdmtaskservice --cov-report=xml test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true