Skip to content

Commit

Permalink
Migrate to common-gh-actions (#217)
Browse files Browse the repository at this point in the history
* Migrate to common-gh-actions

* Revert PyPI deploy b/c of permissions issues

* PR feedback
  • Loading branch information
kroenlein authored May 15, 2024
1 parent 8b3fdb2 commit 26c6be8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 153 deletions.
31 changes: 0 additions & 31 deletions .github/actions/initialize/action.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/build-docs.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and Deploy Docs

on:
release:
types: [published]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
deploy-docs:
uses: CitrineInformatics/common-gh-actions/.github/workflows/deploy-docs.yml@v1
43 changes: 4 additions & 39 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,7 @@ on:
- 'release/**'

jobs:
check-version:
name: Check version bumped
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize the environment
uses: ./.github/actions/initialize
- name: Check version
run: python scripts/validate_version_bump.py
linting:
name: Run linting with flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize the environment
uses: ./.github/actions/initialize
- name: Lint the source directory
run: flake8 gemd
check-deprecated:
name: Find code marked for removal in this version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize the environment
uses: ./.github/actions/initialize
- name: Deprecated check
run: derp . gemd/__version__.py
check-docs:
name: Check docs for warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Initialize the environment
uses: ./.github/actions/initialize
with:
documentation: 'true'
- name: Build Docs
continue-on-error: true
run: make -C docs/ html SPHINXOPTS='-W --keep-going'
pr-checks:
uses: CitrineInformatics/common-gh-actions/.github/workflows/repo-checks.yml@v1
with:
src: gemd
43 changes: 4 additions & 39 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,7 @@ on:
- 'release/**'

jobs:
run-tests:
name: Execute unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Initialize the environment
uses: ./.github/actions/initialize
- name: Execute unit tests
run: pytest --cov=gemd --cov-report term-missing:skip-covered --cov-config=tox.ini --no-cov-on-fail --cov-fail-under=100 tests/
run-tests-against-latest:
# These runs are intended to confirm the latest minor version of our dependencies we claim to
# support don't break with our latest changes. Since they're not the versions we directly state
# you should use (i.e. in requirements.txt), they arguably aren't critical, hence not blocking.
name: Non-blocking - Execute unit tests against latest version of dependencies
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Initialize the environment
uses: ./.github/actions/initialize
with:
latest: 'true'
- name: Execute unit tests
run: pytest tests/
pr-tests:
uses: CitrineInformatics/common-gh-actions/.github/workflows/run-tests.yml@v1
with:
src: gemd
2 changes: 1 addition & 1 deletion gemd/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1.4"
__version__ = "2.1.5"

0 comments on commit 26c6be8

Please sign in to comment.