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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
19 changes: 19 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
changelog:
exclude:
labels:
- Semver-Ignore
categories:
- title: Breaking Changes
labels:
- Semver-Major
- breaking-change
- title: New Features
labels:
- Semver-Minor
- title: Bug Fixes
labels:
- Semver-Patch
- title: Other Changes
labels:
- Semver-Docs
- "*"
38 changes: 38 additions & 0 deletions .github/workflows/Lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint-and-test
on: [push, workflow_call]
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ "ubuntu-latest", "windows-latest" ]
version: ['3.12']
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.version }}
- name: install requirements
run: uv sync --extra lint --extra test
- name: run ruff check
run: uv run ruff check
- name: run ruff format --check
run: uv run ruff format --check
- name: run pyright
run: uv run pyright
- name: run pytest
run: uv run pytest
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [tests]
steps:
- run: exit 1
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}
24 changes: 24 additions & 0 deletions .github/workflows/check_pr_has_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Check PR has release labels
on:
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
- unlabeled

jobs:
has_label:
name: Check PR has release labels
runs-on: ubuntu-latest
steps:
- run: |
echo "PR does not have a release label."
exit 1
if: |
!contains(github.event.pull_request.labels.*.name, 'Semver-Patch') &&
!contains(github.event.pull_request.labels.*.name, 'Semver-Major') &&
!contains(github.event.pull_request.labels.*.name, 'Semver-Minor') &&
!contains(github.event.pull_request.labels.*.name, 'Semver-Docs') &&
!contains(github.event.pull_request.labels.*.name, 'Semver-Ignore')
19 changes: 19 additions & 0 deletions .github/workflows/dependabot-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Add dependabot PRs to flash reviews
on:
pull_request:
types:
- opened
- reopened
- labeled

jobs:
add_flash_review:
name: Add dependabot PRs to flash reviews
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/ISISComputingGroup/projects/17
github-token: ${{ secrets.PROJECT_TOKEN }}
labeled: dependencies
label-operator: OR
36 changes: 36 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: sphinx

on: [push, pull_request, workflow_call]

jobs:
docs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
- name: install requirements
run: uv sync --extra doc
- name: Sphinx build
run: uv run sphinx-build -E -a -W --keep-going doc _build
- name: run spellcheck
run: uv run sphinx-build -E -a -W --keep-going -b spelling doc _build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: documentation
path: |
_build
if-no-files-found: error
retention-days: 7
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true
9 changes: 9 additions & 0 deletions .github/workflows/lint-and-test-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: lint-and-test-nightly
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
lint-and-test-nightly:
uses: ./.github/workflows/Lint-and-test.yml
88 changes: 88 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Publish Python distribution to PyPI
on: push
jobs:
lint-and-test:
if: github.ref_type == 'tag'
name: Run linter and tests
uses: ./.github/workflows/Lint-and-test.yml
build:
needs: lint-and-test
if: github.ref_type == 'tag'
name: build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v6
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: >-
Publish Python distribution to PyPI
if: github.ref_type == 'tag'
needs: [lint-and-test, build]
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/fastcs-secop
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v7
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: >-
Sign the Python distribution with Sigstore
and upload them to GitHub Release
needs: [lint-and-test, build, publish-to-pypi]
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- name: Download all the dists
uses: actions/download-artifact@v7
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
Loading