build(deps): bump conda-incubator/setup-miniconda from 3.0.3 to 3.0.4… #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [main] | |
tags: | |
- v* | |
# Required shell entrypoint to have properly activated conda environments | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
check: | |
name: Run checks for periodicity-detection on ubuntu with python 3.7 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3.0.4 | |
with: | |
use-mamba: true | |
auto-update-conda: true | |
python-version: "3.7" | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.dev | |
- name: Typcheck with mypy | |
run: | | |
python setup.py typecheck | |
- name: Lint with flake8 | |
run: | | |
flake8 . --count --show-source --statistics | |
test: | |
name: Test periodicity-detection on ${{ matrix.os }} with python ${{ matrix.python_version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 3 | |
matrix: | |
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macOS-latest] | |
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3.0.4 | |
with: | |
use-mamba: true | |
auto-update-conda: true | |
python-version: ${{ matrix.python_version }} | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.dev | |
- name: Test with pytest | |
run: | | |
python setup.py test | |
- name: Extract test coverage | |
if: ${{ matrix.python_version == '3.11' && matrix.os == 'ubuntu-latest' }} | |
run: | | |
SUMMARY=$(sed -n "s/^<coverage.*line-rate=\"\([0-9.]*\)\".*>$/\1/p" coverage.xml) | |
echo "COVERAGE=$(echo ${SUMMARY})" >> $GITHUB_ENV | |
echo "Extracted coverage data: ${COVERAGE}" | |
REF=${{ github.ref }} | |
IFS='/' read -ra PATHS <<< "$REF" | |
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}" | |
echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV | |
echo "Extracted branch name: $BRANCH_NAME" | |
- name: Create coverage badge | |
if: ${{ matrix.python_version == '3.11' && matrix.os == 'ubuntu-latest' }} | |
uses: schneegans/dynamic-badges-action@v1.7.0 | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: 6762bee806477c52e079f21d2f252688 | |
filename: periodicity_detection__${{ env.BRANCH }}.json | |
label: Test Coverage | |
message: ${{ env.COVERAGE }} | |
color: green | |
namedLogo: pytest | |
- name: Upload Coverage to Codecov | |
if: ${{ matrix.python_version == '3.11' && matrix.os == 'ubuntu-latest' }} | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: coverage.xml | |
flags: unittests | |
build-source-distribution: | |
name: Build source distribution | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: | |
- test | |
- check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3.0.4 | |
with: | |
use-mamba: true | |
auto-update-conda: true | |
python-version: 3.7 | |
- name: Build source distribution | |
run: | | |
python setup.py sdist | |
- name: Upload packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages-source | |
path: dist | |
build-manylinux-wheels: | |
name: Build manylinux wheels | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: | |
- test | |
- check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build manylinux Python wheels | |
uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 | |
with: | |
# our wheel is purely python, so this creates a *-none-any.wheel and other versions are not required for now | |
python-versions: 'cp37-cp37m' | |
- name: List packages | |
run: | | |
ls -alh dist | |
- name: Upload packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages-manylinux | |
path: dist/*.whl | |
publish: | |
name: Publish distributions | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: [build-source-distribution, build-manylinux-wheels] | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
- name: Download packages | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
- name: Restore original folder structure of dist | |
run: | | |
find dist -type f -exec mv {} dist/ \; | |
find dist/* -type d -exec rmdir {} \; || true | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.8.14 |