Skip to content

Dev/setup jatic cicd #27

Dev/setup jatic cicd

Dev/setup jatic cicd #27

# This is a basic workflow to help you get started with Actions
name: Unit Testing
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- master
- release
pull_request:
branches:
- master
- release
- update-to-v*
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
shell: bash
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
# NOTE: Github actions does not support anchors apparently. Forgive duplication of job
# steps.
jobs:
unittests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9","3.10","3.11","3.12"]
# Extras for included, optional plugin support (space-separated lists)
opt-extra: [
"", # no extras
"tools example_deps",
]
# We want all python versions tested even if one of them happens to fail
fail-fast: false
container: python:${{ matrix.python-version }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Cache local python environment artifacts for the current python version
# and poetry lockfile hash.
- uses: actions/cache@v4
id: env-cache
with:
# Confirmed that the `.local` directory doesn't exist until the
# `pip install --user` is invoked below, so we can be confident that
# only our python stuff is being captured in this cache (intentional).
path: |
~/.cache
key: python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}-${{ matrix.opt-extra }}
restore-keys: |
python-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Setup Environment
uses: ./.github/actions/test-stage
# - name: Synchronize Poetry Environment
# run: poetry install --sync --only main,dev-linting,dev-testing --extras "$OPT_EXTRA"
with:
extras: "${{ matrix.opt-extra }}"
- name: Unit Testing
run: poetry run pytest
- name: CodeCov report submission
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: coverage.xml
flags: unittests