Update GitHub Action Versions #1449
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': | |
pull_request: null | |
workflow_dispatch: null | |
concurrency: | |
group: '${{ github.workflow }}-${{ github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
detect-ci-trigger: | |
name: detect ci trigger | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' || github.event_name == 'pull_request' | |
outputs: | |
triggered: '${{ steps.detect-trigger.outputs.trigger-found }}' | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 2 | |
- uses: xarray-contrib/[email protected] | |
id: detect-trigger | |
with: | |
keyword: '[skip-ci]' | |
test: | |
name: pytest | |
runs-on: ubuntu-latest | |
needs: detect-ci-trigger | |
if: needs.detect-ci-trigger.outputs.triggered == 'false' | |
defaults: | |
run: | |
shell: 'bash -l {0}' | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Set up conda | |
uses: conda-incubator/[email protected] | |
with: | |
auto-update-conda: false | |
channels: conda-forge | |
miniforge-variant: Mambaforge | |
activate-environment: bitinfo-tests | |
python-version: '3.11' | |
environment-file: tests/environment.yml | |
- name: Conda info | |
run: conda info | |
- name: Conda list | |
run: conda list | |
- name: install xbitinfo | |
run: | | |
pip install . | |
- name: Run tests | |
run: pytest | |
doctest: | |
name: doctests | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: 'bash -l {0}' | |
steps: | |
- uses: actions/[email protected] | |
- uses: conda-incubator/[email protected] | |
with: | |
channels: conda-forge | |
miniforge-variant: Mambaforge | |
activate-environment: bitinfo-tests | |
auto-update-conda: false | |
python-version: '3.11' | |
environment-file: tests/environment.yml | |
- name: Install xbitinfo | |
run: | | |
python -m pip install -e . | |
- name: Conda info | |
run: conda info | |
- name: Conda list | |
run: conda list | |
- name: Run doctests | |
run: | | |
python -m pytest --doctest-modules xbitinfo --ignore xbitinfo/tests | |
test_notebooks: | |
name: notebooks | |
runs-on: ubuntu-latest | |
needs: detect-ci-trigger | |
if: needs.detect-ci-trigger.outputs.triggered == 'false' | |
defaults: | |
run: | |
shell: 'bash -l {0}' | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up conda | |
uses: conda-incubator/[email protected] | |
with: | |
auto-update-conda: false | |
channels: conda-forge | |
miniforge-variant: Mambaforge | |
activate-environment: bitinfo-docs | |
python-version: '3.11' | |
environment-file: docs/environment.yml | |
- name: Remove julia (issue #212) | |
run: | | |
conda remove julia | |
- name: Conda info | |
run: conda info | |
- name: Conda list | |
run: conda list | |
- name: install xbitinfo | |
run: | | |
pip install . --upgrade pip | |
- name: Test notebooks | |
run: > | |
python -m ipykernel install --user --name bitinfo-docs | |
jupyter nbconvert --to html --execute docs/*.ipynb | |
--ExecutePreprocessor.kernel_name=bitinfo-docs | |
install: | |
name: 'install xbitinfo, ${{ matrix.os }}' | |
runs-on: '${{ matrix.os }}' | |
needs: detect-ci-trigger | |
if: needs.detect-ci-trigger.outputs.triggered == 'false' | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.11' | |
- name: Set up Julia | |
uses: julia-actions/[email protected] | |
with: | |
version: 1.7.1 | |
- name: Install dependencies | |
run: | | |
pip install .[complete] | |
python -c "import xbitinfo" |