Skip to content

Commit

Permalink
Update workflows (#503)
Browse files Browse the repository at this point in the history
Summary of changes:

 1.   updated all the used action versions to the latest vesion, as some were really quite out of date, and made any changes necessary to fix whatever broke
  2.  removed black in favour of ruff formatting as ruff formatting implements the same formatting rules as black but runs at least an order of magnitude faster
  3.  did the same two things for the pre-commit config
   4.  ran pre-commit on all files
    5. removed the manual linting steps in favor of just using the pre-commit action which is both faster (does better caching) and ensures both local and ci checks are consistent
  • Loading branch information
savente93 authored Aug 1, 2024
1 parent 5662036 commit a562b55
Show file tree
Hide file tree
Showing 87 changed files with 341 additions and 441 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug Report
description: Report incorrect behavior
description: Report incorrect behavior
labels: [bug, needs refinement]

body:
Expand All @@ -18,8 +18,8 @@ body:
attributes:
description: >
Please provide a minimal, copy-pastable example or a link to a public repository that reproduces the behavior. If providing a copy pastable example,
you may assume your in a clean up to date version of FloodAdapt with a python enviroment active. In the case of a repository, ensure the repository
has a README.md which includes intructions to reproduce the behaviour.
you may assume your in a clean up to date version of FloodAdapt with a python environment active. In the case of a repository, ensure the repository
has a README.md which includes instructions to reproduce the behaviour.
label: Reproducible Example
validations:
required: true
Expand All @@ -43,7 +43,7 @@ body:
id: task-list
attributes:
description: >
Please provide a list of tasks that need to be completed before this issue can be closed.
Please provide a list of tasks that need to be completed before this issue can be closed.
label: Task list
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ body:
id: task-list
attributes:
description: >
Please provide a list of tasks that need to be completed before this issue can be closed.
Please provide a list of tasks that need to be completed before this issue can be closed.
label: Task list
validations:
required: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/auto_code_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
# Set up Git to use the GitHub Actions token for authentication
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# Commit and push the changes
git add .
git -c user.name='github-actions[bot]' -c user.email='github-actions[bot]@users.noreply.github.com' commit -m 'Update Wiki'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [main]
workflow_dispatch:

permissions:
contents: write

Expand All @@ -30,10 +30,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Miniforge3
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Miniforge3
Expand All @@ -59,12 +59,12 @@ jobs:
- name: Generate docs
run: |
export PATH=/usr/share/miniconda3/bin:$PATH
source /usr/share/miniconda3/etc/profile.d/conda.sh
source /usr/share/miniconda/etc/profile.d/conda.sh
mamba run -n floodadapt_docs quarto render docs/ --execute
- name: Upload to GitHub Pages
if: ${{ github.event_name != 'pull_request' && !github.event.act }}
uses: peaceiris/actions-gh-pages@v3.9.3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_site
Expand Down
49 changes: 11 additions & 38 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
name: CI
on: push
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install ruff==0.4.8 # Make sure these are the same as the versions in pyproject.toml
# Include `--format=github` to enable automatic inline annotations.
- name: Run Ruff
run: ruff check . --fix
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install black==24.1.1 # Make sure these are the same as the versions in pyproject.toml
- name: Check black version
run: black --version
- name: Run black
run: black --check .
name: pre-commit

on:
pull_request:
push:
branches: [main]

typos:
name: Spell Check with Typos
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling
uses: crate-ci/typos@master
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
27 changes: 0 additions & 27 deletions .github/workflows/lint_and_test.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
build-artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Build artifacts
run: make pypi

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: releases
path: dist
Expand All @@ -38,9 +38,9 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: releases
path: dist
Expand All @@ -49,7 +49,7 @@ jobs:
ls -ltrh
ls -ltrh dist
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand All @@ -62,12 +62,12 @@ jobs:
needs: test-built-dist
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: releases
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.1
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
Expand Down
21 changes: 10 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -12,16 +12,15 @@ repos:
exclude: '^environment/'
- id: check-merge-conflict
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.5
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
- repo: https://github.com/crate-ci/typos
rev: v1.22.7
rev: v1.23.6
hooks:
- id: typos
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,3 @@ call pytest tests --junitxml="report.xml"]]></param>
<cleanup />
</settings>
</build-type>

1 change: 0 additions & 1 deletion .teamcity/FloodAdapt/project-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
</project-extensions>
<cleanup />
</project>

1 change: 0 additions & 1 deletion .teamcity/FloodAdapt/vcsRoots/FloodAdapt_FloodAdapt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
<param name="username" value="teamcity-deltares" />
<param name="usernameStyle" value="USERID" />
</vcs-root>

1 change: 0 additions & 1 deletion .teamcity/FloodAdapt/vcsRoots/FloodAdapt_SfincTestData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
<param name="user" value="%svn_buildserver_username%" />
<param name="working-copy-format" value="1.8" />
</vcs-root>

Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
<param name="user" value="peiter" />
<param name="working-copy-format" value="1.8" />
</vcs-root>

3 changes: 1 addition & 2 deletions _extensions/quarto-ext/fontawesome/assets/css/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.fa-regular,
.fab,
.fa-brands,
.fal,
.fal,
.fa-light,
.fat,
.fa-thin,
Expand Down Expand Up @@ -7968,4 +7968,3 @@ readers do not read off random characters that represent icons */
font-display: block;
src: url("../webfonts/FontAwesome6Free-Regular-400.woff2") format("woff2"), url("../../webfonts/FontAwesome6Free-Regular-400.ttf") format("truetype");
unicode-range: U+F003,U+F006,U+F014,U+F016-F017,U+F01A-F01B,U+F01D,U+F022,U+F03E,U+F044,U+F046,U+F05C-F05D,U+F06E,U+F070,U+F087-F088,U+F08A,U+F094,U+F096-F097,U+F09D,U+F0A0,U+F0A2,U+F0A4-F0A7,U+F0C5,U+F0C7,U+F0E5-F0E6,U+F0EB,U+F0F6-F0F8,U+F10C,U+F114-F115,U+F118-F11A,U+F11C-F11D,U+F133,U+F147,U+F14E,U+F150-F152,U+F185-F186,U+F18E,U+F190-F192,U+F196,U+F1C1-F1C9,U+F1D9,U+F1DB,U+F1E3,U+F1EA,U+F1F7,U+F1F9,U+F20A,U+F247-F248,U+F24A,U+F24D,U+F255-F25B,U+F25D,U+F271-F274,U+F278,U+F27B,U+F28C,U+F28E,U+F29C,U+F2B5,U+F2B7,U+F2BA,U+F2BC,U+F2BE,U+F2C0-F2C1,U+F2C3,U+F2D0,U+F2D2,U+F2D4,U+F2DC; }

4 changes: 2 additions & 2 deletions _extensions/quarto-ext/fontawesome/fontawesome.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ return {
group = icon
icon = pandoc.utils.stringify(args[2])
end

local title = pandoc.utils.stringify(kwargs["title"])
if not isEmpty(title) then
title = " title=\"" .. title .. "\""
Expand All @@ -58,7 +58,7 @@ return {
end

local size = pandoc.utils.stringify(kwargs["size"])

-- detect html (excluding epub which won't handle fa)
if quarto.doc.is_format("html:js") then
ensureHtmlDeps()
Expand Down
1 change: 0 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
!api/.gitkeep
*.jupyter_cache/
objects.json

Loading

0 comments on commit a562b55

Please sign in to comment.