-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #401 from firedrakeproject/JDBetteridge/CI_changes
PR #401: improvements to CI
- Loading branch information
Showing
5 changed files
with
115 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Check docs build cleanly | ||
|
||
on: | ||
# Run on pushes to master | ||
push: | ||
branches: | ||
- master | ||
# And all pull requests | ||
pull_request: | ||
|
||
concurrency: | ||
# Cancels jobs running if new commits are pushed | ||
group: > | ||
${{ github.workflow }}- | ||
${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_docs: | ||
name: Run doc build | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# The docker container to use. | ||
container: | ||
image: firedrakeproject/firedrake-docdeps:latest | ||
options: --user root | ||
volumes: | ||
- ${{ github.workspace }}:/home/firedrake/output | ||
# Steps represent a sequence of tasks that will be executed as | ||
# part of the jobs | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install checkedout Gusto | ||
run: | | ||
. /home/firedrake/firedrake/bin/activate | ||
python -m pip install -e . | ||
- name: Install Read the Docs theme | ||
run: | | ||
. /home/firedrake/firedrake/bin/activate | ||
python -m pip install sphinx_rtd_theme | ||
- name: Check documentation links | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
run: | | ||
. /home/firedrake/firedrake/bin/activate | ||
cd docs | ||
make linkcheck | ||
- name: Build docs | ||
run: | | ||
. /home/firedrake/firedrake/bin/activate | ||
cd docs | ||
make html | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
name: github-pages | ||
path: /__w/gusto/gusto/docs/build/html | ||
retention-days: 1 |
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,40 @@ | ||
name: Run lint | ||
|
||
on: | ||
# Push to master or PR | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
linter: | ||
name: "Run linter" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Setup flake8 annotations | ||
uses: rbialon/flake8-annotations@v1 | ||
- name: Install linter | ||
run: | | ||
pip install flake8 pylint | ||
- name: Lint codebase | ||
run: | | ||
make lint GITHUB_ACTIONS_FORMATTING=1 | ||
actionlint: | ||
name: "Lint Github actions YAML files" | ||
# There's a way to add error formatting so GH actions adds messages to code, | ||
# but I can't work out the right number of quotes to get it to work | ||
# https://github.com/rhysd/actionlint/blob/main/docs/usage.md | ||
# #example-error-annotation-on-github-actions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check workflow files | ||
uses: docker://rhysd/actionlint:latest | ||
with: | ||
args: -color |
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