Skip to content

Commit

Permalink
Simplied shell runs in GitHub Actions (scikit-bio#1947)
Browse files Browse the repository at this point in the history
* updated URL and doc build

* Revert "updated URL and doc build"

This reverts commit 69e15b2.

* simplified github actions
  • Loading branch information
qiyunzhu authored Feb 22, 2024
1 parent 2ebfee1 commit a135849
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
name: Lint code (${{ needs.conf.outputs.latest_python }}, ubuntu-latest)
needs: conf
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
Expand All @@ -44,19 +47,20 @@ jobs:
miniforge-variant: ${{ env.miniforge_variant }}
environment-file: ci/conda_host_env.yml
- name: Install dependencies
shell: bash -l {0}
run: |
pip install -r ci/requirements.lint.txt
conda list
- name: Run Ruff
shell: bash -l {0}
run: |
ruff check --output-format=github .
doc:
name: Build Documentation (${{ needs.conf.outputs.latest_python }}, ubuntu-latest)
needs: ["conf", "lint"]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
Expand All @@ -67,18 +71,15 @@ jobs:
miniforge-variant: ${{ env.miniforge_variant }}
environment-file: ci/conda_host_env.yml
- name: Install dependencies
shell: bash -l {0}
run: |
pip install -r ci/requirements.doc.txt
pip install .
conda list
- name: Make documentation
shell: bash -l {0}
run: make doc
# save built documentation (HTML) for deployment
- name: Substitute URLs
if: github.event_name == 'push'
shell: bash -l {0}
run: python doc/suburl.py
- name: Save documentation
if: github.event_name == 'push'
Expand All @@ -94,6 +95,9 @@ jobs:
env:
MPLBACKEND: Agg
USE_CYTHON: TRUE
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: true
matrix:
Expand All @@ -108,12 +112,10 @@ jobs:
miniforge-variant: ${{ env.miniforge_variant }}
environment-file: ci/conda_host_env.yml
- name: Install dependencies
shell: bash -l {0}
run: |
pip install .
conda list
- name: Run unit tests
shell: bash -l {0}
env:
WITH_COVERAGE: "TRUE"
run: make test
Expand Down Expand Up @@ -150,6 +152,9 @@ jobs:
env:
# not testing Cython here, whether the Cython compiles to C is tested above
MPLBACKEND: Agg
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
Expand All @@ -167,19 +172,16 @@ jobs:
environment-file: ci/conda_host_env.yml
- name: Install dependencies (conda)
if: ${{ matrix.use_conda }}
shell: bash -l {0}
run: |
conda install -q --yes -c conda-forge --file ci/conda_requirements.txt
pip install . --no-deps
conda list
- name: Install dependencies
if: ${{ !matrix.use_conda }}
shell: bash -l {0}
run: |
pip install .
conda list
- name: Run unit tests
shell: bash -l {0}
env:
WITH_COVERAGE: "TRUE"
run: make test
Expand All @@ -191,6 +193,9 @@ jobs:
if: github.event_name == 'push'
needs: ["doc", "test-all", "test-cython-aarch64"]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
# load documentation built by job "doc"
- name: Load documentation
Expand All @@ -207,11 +212,9 @@ jobs:
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}
# synchronize documentation to website's docs/dev directory
- name: Update documentation
shell: bash -l {0}
run: rsync -av --delete docpack/ website/docs/dev
# push website back to repo
- name: Push website
shell: bash -l {0}
run: |
cd website
git config user.name "${{ github.actor }}"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
build:
name: Build website
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Check out repo
uses: actions/checkout@v4
Expand All @@ -31,21 +34,17 @@ jobs:
miniforge-variant: ${{ env.miniforge_variant }}

- name: Install dependencies
shell: bash -l {0}
run: pip install -r ci/requirements.doc.txt

- name: Make website
shell: bash -l {0}
run: make web

- name: Substitute URLs
if: github.event_name == 'push'
shell: bash -l {0}
run: python web/suburl.py

- name: Add version list
if: github.event_name == 'push'
shell: bash -l {0}
run: cp web/versions.json web/_build/html/

- name: Save website package
Expand All @@ -60,6 +59,9 @@ jobs:
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Check out repo
uses: actions/checkout@v4
Expand All @@ -78,11 +80,9 @@ jobs:
ssh-key: ${{ secrets.SSH_DEPLOY_KEY }}

- name: Update website
shell: bash -l {0}
run: rsync -av --delete --exclude-from web/.exclude webpack/ website

- name: Push website
shell: bash -l {0}
run: |
cd website
git config user.name "${{ github.actor }}"
Expand Down

0 comments on commit a135849

Please sign in to comment.