Merge pull request #70 from zjzjwang/single_precision #298
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: CI | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- '*' | |
pull_request: | |
branches: ['*'] | |
workflow_dispatch: | |
jobs: | |
linux-unittest: | |
name: Linux unittest - ${{ matrix.PYTHON_VERSION }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
PYTHON_VERSION: ["3.7", "3.10"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup conda cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
mamba--${{ hashFiles('environment.yml') }}-${{ matrix.PYTHON_VERSION }} | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.PYTHON_VERSION }} | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
activate-environment: lleaves | |
environment-file: environment.yml | |
use-only-tar-bz2: true | |
use-mamba: true | |
- name: Setup hypothesis DB cache | |
uses: actions/cache@v3 | |
with: | |
path: ./.hypothesis | |
key: hypothesisDB ${{ matrix.PYTHON_VERSION }} | |
- name: Run the unittests | |
shell: bash -x -l {0} | |
run: ./.github/ci.sh ${{ matrix.PYTHON_VERSION }} | |
- name: Publish a Python distribution to PyPI | |
if: startsWith(github.ref, 'refs/tags') && matrix.PYTHON_VERSION == '3.7' | |
uses: pypa/gh-action-pypi-publish@v1.8.11 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
pre-commit-checks: | |
name: "Pre-commit checks - Python 3.9" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Install Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Run pre-commit checks | |
uses: pre-commit/action@v3.0.0 |