Skip to content

Commit

Permalink
Merge pull request #332 from ImperialCollegeLondon/drop_ga_precommit
Browse files Browse the repository at this point in the history
Drop pre-commit checking from GitHub Actions
  • Loading branch information
alexdewar authored Oct 5, 2023
2 parents 8267d20 + eacb8e7 commit 8e7764d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 87 deletions.
127 changes: 60 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,108 +3,101 @@ name: Test and build
on: [push, pull_request, release]

jobs:
qa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/action@v3.0.0

check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
name: Check links in markdown files
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
use-quiet-mode: "yes"
use-verbose-mode: "yes"

test:
needs: qa
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest ]
python-version: [ "3.11" ]
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ["3.11"]

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

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies in Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
- name: Install system dependencies in Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
# Without this, PySide6 gives an ImportError
sudo apt install libegl1
# Without this, PySide6 gives an ImportError
sudo apt install libegl1
- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.2.2
- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.2.2

- name: Install dependencies
run: poetry install
- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest --cov-report=xml
env:
QT_QPA_PLATFORM: offscreen
- name: Run tests
run: poetry run pytest --cov-report=xml
env:
QT_QPA_PLATFORM: offscreen

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && success()
uses: codecov/codecov-action@v3
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && success()
uses: codecov/codecov-action@v3

- name: Check for documentation errors with MkDocs
run: |
poetry run mkdocs build -s
- name: Check for documentation errors with MkDocs
run: |
poetry run mkdocs build -s
- name: Build package
if: matrix.os == 'windows-latest'
run: poetry run pyinstaller FINESSE.spec
- name: Build package
if: matrix.os == 'windows-latest'
run: poetry run pyinstaller FINESSE.spec

- uses: actions/upload-artifact@v3
if: success() && matrix.os == 'windows-latest'
with:
name: FINESSE
path: dist/FINESSE.exe
- uses: actions/upload-artifact@v3
if: success() && matrix.os == 'windows-latest'
with:
name: FINESSE
path: dist/FINESSE.exe

- name: Upload release artifacts
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'windows-latest'
uses: softprops/action-gh-release@v1
with:
files: dist/FINESSE.exe
- name: Upload release artifacts
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'windows-latest'
uses: softprops/action-gh-release@v1
with:
files: dist/FINESSE.exe

docs:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

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

- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install system dependencies in Linux
run: |
sudo apt update
- name: Install system dependencies in Linux
run: |
sudo apt update
# Without this, PySide6 gives an ImportError
sudo apt install libegl1
# Without this, PySide6 gives an ImportError
sudo apt install libegl1
- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.2.2
- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.2.2

- name: Install dependencies
run: poetry install
- name: Install dependencies
run: poetry install

- name: Deploy Docs
run: poetry run mkdocs gh-deploy --force
- name: Deploy Docs
run: poetry run mkdocs gh-deploy --force
20 changes: 0 additions & 20 deletions .github/workflows/pre-commit_autoupdate.yml

This file was deleted.

0 comments on commit 8e7764d

Please sign in to comment.