Skip to content

Commit

Permalink
Merge branch 'moist_thermal_sw' of https://github.com/firedrakeprojec…
Browse files Browse the repository at this point in the history
…t/gusto into moist_thermal_sw
  • Loading branch information
nhartney committed Jul 28, 2023
2 parents 7b4002d + bb02241 commit d382306
Show file tree
Hide file tree
Showing 113 changed files with 3,214 additions and 2,589 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,14 @@ jobs:
. /home/firedrake/firedrake/bin/activate
python -m pip install -r requirements.txt
python -m pip install -e .
- name: Gusto unit-tests
python -m pip install \
pytest-cov pytest-timeout pytest-xdist
- name: Gusto tests
run: |
. /home/firedrake/firedrake/bin/activate
python $(which firedrake-clean)
python -m pytest -n 12 -v unit-tests
- name: Gusto integration-tests
run: |
. /home/firedrake/firedrake/bin/activate
python $(which firedrake-clean)
python -m pytest -n 12 -v integration-tests
- name: Gusto examples
run: |
. /home/firedrake/firedrake/bin/activate
python $(which firedrake-clean)
python -m pytest -n 12 -v examples
- name: Lint
if: ${{ always() }}
run: |
. /home/firedrake/firedrake/bin/activate
make lint
which firedrake-clean
python -m pytest \
-n 12 --dist worksteal \
--durations=100 \
--cov gusto \
-v unit-tests integration-tests examples
57 changes: 57 additions & 0 deletions .github/workflows/docs.yml
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
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
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
53 changes: 53 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll with GitHub Pages dependencies preinstalled

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./docs/_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./docs/_site/

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# Adds file annotations to Github Actions (only useful on CI)
GITHUB_ACTIONS_FORMATTING=0
ifeq ($(GITHUB_ACTIONS_FORMATTING), 1)
FLAKE8_FORMAT=--format='::error file=%(path)s,line=%(row)d,col=%(col)d,title=%(code)s::%(path)s:%(row)d:%(col)d: %(code)s %(text)s'
else
FLAKE8_FORMAT=
endif

lint:
@echo " Linting gusto codebase"
@python3 -m flake8 gusto
@python3 -m flake8 $(FLAKE8_FORMAT) gusto
@echo " Linting gusto examples"
@python3 -m flake8 examples
@python3 -m flake8 $(FLAKE8_FORMAT) examples
@echo " Linting gusto unit-tests"
@python3 -m flake8 unit-tests
@python3 -m flake8 $(FLAKE8_FORMAT) unit-tests
@echo " Linting gusto integration-tests"
@python3 -m flake8 integration-tests
@python3 -m flake8 $(FLAKE8_FORMAT) integration-tests
@echo " Linting gusto plotting scripts"
@python3 -m flake8 plotting
@python3 -m flake8 $(FLAKE8_FORMAT) plotting

test:
@echo " Running all tests"
Expand All @@ -24,4 +32,4 @@ integration_test:

example:
@echo " Running all examples"
@python3 -m pytest examples $(PYTEST_ARGS)
@python3 -m pytest examples $(PYTEST_ARGS)
2 changes: 1 addition & 1 deletion docs/_includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ul>
<li class="logo" style="float:left""><a href="{{ site.url }}/gusto/" style="padding-bottom:0px"><img id="navbarimg" src="{{'assets/images/gusto_navbar.png'}}" style="max-width:160px; max-height:60px; height:auto; width:auto; padding-top:10px" /></a></li>
<li class="page_item" style="float:right"><a href="https://github.com/firedrakeproject/gusto">Github</a></li>
<li class="page_item" style="float:right"><a href="https://firedrakeproject.org/gusto/">Docs</a></li>
<li class="page_item" style="float:right"><a href="https://firedrakeproject.org/gusto-docs">Docs</a></li>
<li class="page_item" style="float:right"><a href="{{ site.url }}/gusto/about_gusto.html">About</a>
<ul id="dropdown" style="padding-top:20px;">
<li><a href="{{ site.url }}/gusto/about_gusto.html#download">Download</a></li>
Expand Down
93 changes: 0 additions & 93 deletions docs/_site/404.html

This file was deleted.

Loading

0 comments on commit d382306

Please sign in to comment.