Skip to content

CI: Harden GHA configuration #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion .github/.github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: Lighthouse
permissions:
contents: read
on: [push, pull_request]
jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
persist-credentials: false

- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand All @@ -22,7 +26,7 @@ jobs:
make html

- name: Run Lighthouse against example docs build
uses: treosh/lighthouse-ci-action@v2
uses: treosh/lighthouse-ci-action@005e1277a8a17ea0b0ef6c3332d59a7cd0f730ce # v2
with:
configPath: "./lighthouserc.json"
temporaryPublicStorage: true
6 changes: 5 additions & 1 deletion .github/.github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Linting
permissions:
contents: read

on:
push:
Expand All @@ -12,5 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
- uses: pre-commit/action@0764670bf370aab253130d534e1eda7ff497dc60 # v2.0.0
11 changes: 9 additions & 2 deletions .github/.github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Push to PyPI
permissions:
contents: read

on:
push:
Expand All @@ -8,10 +10,15 @@ on:
jobs:
publish:
runs-on: ubuntu-latest

permissions:
id-token: write
attestations: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v1
with:
persist-credentials: false

- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand All @@ -29,7 +36,7 @@ jobs:
python setup.py sdist bdist_wheel

- name: Publish mpl-sphinx-theme
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
user: __token__
password: ${{ secrets.pypi_token }}
2 changes: 1 addition & 1 deletion .github/.githubold/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
uses: larsoner/circleci-artifacts-redirector-action@master
uses: scientific-python/circleci-artifacts-redirector-action@7eafdb60666f57706a5525a2f5eb76224dc8779b # v1.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifact-path: 0/docs/_build/html/index.html
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/mpl_sphinx_theme.egg-info/
/mpl_sphinx_theme/__pycache__/
build
dist