-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0918e8
commit d98f100
Showing
3 changed files
with
219 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,8 @@ jobs: | |
runs-on: ${{ matrix.config.os }} | ||
name: Check ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
strategy: | ||
fail-fast: false | ||
# When set to true, GitHub cancels all in-progress jobs if any matrix job fails. | ||
fail-fast: true | ||
matrix: | ||
config: | ||
- {os: windows-latest, r: 'release'} | ||
|
@@ -43,6 +44,10 @@ jobs: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- name: Disable autocrlf | ||
if: runner.os == 'Windows' | ||
run: git config --global core.autocrlf false | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
@@ -210,6 +215,6 @@ jobs: | |
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
setwd("R/") | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE)' | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE, subdir = "r")' | ||
shell: bash {0} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
name: Python | ||
|
||
on: | ||
push: | ||
branches-ignore: [gh-pages] | ||
paths: | ||
- ".github/workflows/python.yml" | ||
- "src/**" | ||
- "python/**" | ||
pull_request: | ||
branches-ignore: [gh-pages] | ||
paths: | ||
- ".github/workflows/python.yml" | ||
- "src/**" | ||
- "python/**" | ||
|
||
concurrency: | ||
group: ${{ github.event.pull_request.number || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint-black: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: psf/black@stable | ||
src: "./python" | ||
|
||
run-tests: | ||
timeout-minutes: 15 | ||
needs: lint-black | ||
if: "! contains(github.event.head_commit.message, '[skip ci]')" | ||
name: Test ${{ matrix.c.os }} (${{ matrix.c.python-version }}) | ||
runs-on: ${{ matrix.c.os }} | ||
strategy: | ||
# When set to true, GitHub cancels all in-progress jobs if any matrix job fails. | ||
fail-fast: true | ||
# The maximum number of jobs that can run simultaneously | ||
max-parallel: 1 | ||
matrix: | ||
c: | ||
- {os: ubuntu-latest, python-version: '3.9'} | ||
- {os: ubuntu-latest, python-version: '3.10'} | ||
- {os: ubuntu-latest, python-version: '3.11'} | ||
- {os: windows-latest, python-version: '3.11'} | ||
- {os: macos-latest, python-version: '3.11'} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.c.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.c.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox tox-gh-actions | ||
- name: Run tox | ||
run: cd python && tox | ||
|
||
build-package: | ||
timeout-minutes: 10 | ||
needs: run-tests | ||
if: "! contains(github.event.head_commit.message, '[skip ci]')" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.10"] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install --upgrade build | ||
- name: Build the packages | ||
run: | | ||
cd python | ||
python3 -m build | ||
- name: Publish artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: distributions | ||
path: python/dist/ | ||
|
||
build-doc: | ||
timeout-minutes: 10 | ||
needs: build-package | ||
if: "! contains(github.event.head_commit.message, '[skip ci]')" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Ensure Pip and Build | ||
run: | ||
pip install --upgrade pip | ||
pip install --upgrade build | ||
|
||
- name: build the package | ||
run: | | ||
cd python | ||
python3 -m build | ||
- name: install the package | ||
run: | | ||
cd python | ||
pip install . | ||
- name: install the doc build requirements | ||
run: | | ||
cd python | ||
pip install -r requirements_dev.txt | ||
- name: Build the docs | ||
run: | | ||
cd python | ||
make -C doc clean | ||
tox -e docs | ||
make -C doc html | ||
- name: Upload docs as github pages artifact | ||
uses: actions/upload-pages-artifact@main | ||
with: | ||
path: python/doc/_build/html/ | ||
|
||
deploy-doc: | ||
needs: build-doc | ||
if: "! contains(github.event.head_commit.message, '[skip ci]')" | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get the built docs | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: github-pages | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: . # The folder the action should deploy. | ||
target-folder: python | ||
|
||
coverage: | ||
timeout-minutes: 15 | ||
needs: build-doc | ||
if: "! contains(github.event.head_commit.message, '[skip ci]')" | ||
name: Coverage ${{ matrix.c.os }} (${{ matrix.c.python-version }}) | ||
runs-on: ${{ matrix.c.os }} | ||
strategy: | ||
# When set to true, GitHub cancels all in-progress jobs if any matrix job fails. | ||
fail-fast: true | ||
# The maximum number of jobs that can run simultaneously | ||
max-parallel: 1 | ||
matrix: | ||
c: | ||
- {os: ubuntu-latest, python-version: '3.11'} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.c.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.c.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
cd python | ||
python -m pip install --upgrade pip | ||
python -m pip install tox tox-gh-actions | ||
- name: Run coverage using tox | ||
run: | | ||
cd python | ||
tox -e coverage | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
verbose: true | ||
|