Skip to content

Package/update ax to 0.3.3 #523

Package/update ax to 0.3.3

Package/update ax to 0.3.3 #523

Workflow file for this run

name: ci
on:
push:
pull_request:
branches:
- develop
- main
env:
CACHE_NUMBER: 0 # increase to reset cache manually
jobs:
pre_job:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md", "**/docs/**"]'
do_not_skip: '["workflow_dispatch", "schedule"]'
ci:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu
label: linux-64
prefix: /usr/share/miniconda3/envs/boa
- os: macos
label: osx-64
prefix: /Users/runner/miniconda3/envs/boa
- os: windows
label: win-64
prefix: C:\Miniconda3\envs\boa
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: 3.9
activate-environment: boa
use-mamba: true
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('environment_dev.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache
- name: Update base environment
run: mamba env update -n boa -f environment_dev.yml --prune
if: steps.cache.outputs.cache-hit != 'true'
- name: export env to artifact
run: mamba env export -n boa > environment_ci.yml
- uses: actions/upload-artifact@v3
with:
name: environment_ci.yml
path: environment_ci.yml
- name: Lint
shell: bash -l {0}
run: |
invoke style --checkonly
- name: Run tests
shell: bash -l {0}
run: invoke tests --options '-s -v --cov=boa --cov-branch --cov-report=xml'
- name: Upload coverage to Codecov
if: startsWith(matrix.os, 'ubuntu')
uses: codecov/codecov-action@v3
- name: Pytest coverage comment
if: startsWith(matrix.os, 'ubuntu')
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./coverage.xml
- name: Test package builds successfully
shell: bash -l {0}
run: |
python -m pip install build
python -m build
# Report final results of the matrix tests
result:
name: Result
if: needs.pre_job.outputs.should_skip != 'true' && always()
runs-on: ubuntu-latest
needs:
- pre_job
- ci
steps:
- name: Mark result as failed
if: needs.ci.result != 'success'
run: exit 1