Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: codecoverage

permissions:
contents: read

on:
pull_request:
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: lint

permissions:
contents: read

on:
push:
branches:
Expand Down
42 changes: 34 additions & 8 deletions .github/workflows/subscript.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: subscript

permissions:
contents: read

Comment thread
rnyb marked this conversation as resolved.
Comment thread
rnyb marked this conversation as resolved.
on:
push:
branches:
Expand All @@ -21,7 +24,7 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
subscript:
test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -67,7 +70,6 @@ jobs:
sudo apt-get install libopm-simulators-bin

- name: Install subscript with dependencies
if: ${{ always() }}
run: |
uv pip install ".[tests, docs]"

Expand All @@ -83,21 +85,45 @@ jobs:
run: uv pip freeze

- name: Run tests
if: ${{ always() }}
run: pytest -n logical tests --mpl

- name: Syntax check documentation
if: ${{ always() }}
if: ${{ !cancelled() }}
run: rstcheck -r docs

- name: Build documentation
if: ${{ always() }}
if: ${{ !cancelled() }}
run: sphinx-build -b html docs build/docs/html

- name: Upload documentation artifact
if: matrix.python-version == '3.12' && success()
uses: actions/upload-artifact@v4
with:
name: docs-html
path: build/docs/html

deploy-docs:
needs: test
if: github.repository_owner == 'equinor' && github.ref == 'refs/heads/main'
Comment thread
rnyb marked this conversation as resolved.
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout commit locally
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Download documentation artifact
uses: actions/download-artifact@v4
with:
name: docs-html
path: docs-html

- name: Update GitHub pages
if: github.repository_owner == 'equinor' && github.ref == 'refs/heads/main' && matrix.python-version == '3.12'
run: |
Comment thread
rnyb marked this conversation as resolved.
cp -R ./build/docs/html ../html
cp -R docs-html ../html

git config --local user.email "subscript-github-action"
git config --local user.name "subscript-github-action"
Expand All @@ -114,5 +140,5 @@ jobs:
echo "No changes in documentation. Skip documentation deploy."
else
git commit -m "Update Github Pages"
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
git push origin gh-pages
fi
Loading