generated from aicoe-aiops/project-template
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #66 from os-climate/update-devops-tooling
Chore: Update DevOps tooling from central repository [skip ci]
- Loading branch information
Showing
7 changed files
with
106 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[flake8] | ||
max-line-length = 160 | ||
extend-ignore = E203, E501 |
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,62 @@ | ||
--- | ||
# Run all notebooks on every push | ||
name: "🗒️ Build notebooks" | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, reopened, edited, synchronize] | ||
|
||
jobs: | ||
|
||
parse-project-metadata: | ||
name: "Determine Python versions" | ||
# yamllint disable-line rule:line-length | ||
uses: os-climate/devops-reusable-workflows/.github/workflows/pyproject-toml-fetch-matrix.yaml@main | ||
|
||
notebook-build: | ||
name: "Build and test Notebooks" | ||
needs: [parse-project-metadata] | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
# Don't run when pull request is merged | ||
if: github.event.pull_request.merged == false | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.parse-project-metadata.outputs.matrix) }} | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python ${{ matrix.python-version }}" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: "Setup PDM for build commands" | ||
uses: pdm-project/setup-pdm@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: "Install dependencies" | ||
run: | | ||
which python; which python3 | ||
python --version; python3 --version | ||
python -m pip install --upgrade pip | ||
pdm export -o requirements.txt | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
pip install . | ||
pip install pytest nbmake | ||
- name: "Test notebooks: pytest --nbmake" | ||
run: pytest --nbmake -- **/*ipynb | ||
|
||
- name: Upload logs as artefacts | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: debug-logs | ||
path: /tmp/*.log | ||
retention-days: 14 |
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 |
---|---|---|
|
@@ -55,7 +55,7 @@ jobs: | |
### SIGNING ### | ||
|
||
- name: "Sign packages with Sigstore" | ||
uses: sigstore/[email protected].0 | ||
uses: sigstore/[email protected].1 | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
|
@@ -86,26 +86,12 @@ jobs: | |
name: ${{ github.ref_name }} | ||
path: dist/ | ||
|
||
- name: "📦 Publish release to GitHub" | ||
uses: ModeSevenIndustrialSolutions/action-automatic-releases@latest | ||
with: | ||
# Valid inputs are: | ||
# repo_token, automatic_release_tag, draft, prerelease, title, files | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: false | ||
automatic_release_tag: ${{ github.ref_name }} | ||
title: ${{ github.ref_name }} | ||
files: | | ||
dist/*.tar.gz | ||
dist/*.whl | ||
dist/*.sigstore | ||
- name: "📦 Publish artefacts to GitHub" | ||
# https://github.com/softprops/action-gh-release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: true | ||
prerelease: false | ||
tag_name: ${{ github.ref_name }} | ||
name: "Test/Development Build \ | ||
${{ github.ref_name }}" | ||
|
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 |
---|---|---|
|
@@ -58,6 +58,3 @@ jobs: | |
- name: "Run: pip-audit" | ||
uses: pypa/[email protected] | ||
# with: | ||
# ignore-vulns: | | ||
# PYSEC-2023-163 |
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 |
---|---|---|
|
@@ -62,7 +62,8 @@ jobs: | |
### SIGNING ### | ||
|
||
- name: "Sign packages with Sigstore" | ||
uses: sigstore/[email protected] | ||
uses: sigstore/[email protected] | ||
|
||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
|
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