forked from d70-t/ipldstore
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github actions for testing and pages preview deployments
- Loading branch information
1 parent
f23b651
commit 0a2796c
Showing
4 changed files
with
107 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Deploy static site generated by pdoc to GitHub Pages | ||
on: | ||
push: | ||
branches: ["main"] | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
jobs: | ||
build: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
- name: Create project environment | ||
run: uv sync | ||
- name: Build with pdoc | ||
run: uv run pdoc ipldstore -o ./_site | ||
- name: Upload artifact | ||
# Automatically uploads an artifact from the './_site' directory by default | ||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |
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,41 @@ | ||
# Adapted from https://github.com/github/opensource.guide/blob/main/.github/workflows/jekyll-preview.yml | ||
|
||
name: Deploy static site generated by pdoc to GitHub Pages preview environment | ||
on: pull_request | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
jobs: | ||
build: | ||
environment: | ||
name: "Pages Preview" | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
with: | ||
# For PRs make sure to checkout the PR branch | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
- name: Setup Pages | ||
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
- name: Create project environment | ||
run: uv sync | ||
- name: Build with pdoc | ||
run: uv run pdoc ipldstore -o ./_site | ||
- name: Upload artifact | ||
# Automatically uploads an artifact from the './_site' directory by default | ||
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 | ||
with: | ||
preview: "true" |
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,31 @@ | ||
name: Run checks | ||
run-name: Triggered on push from ${{ github.actor }} to branch/tag ${{ github.ref_name }} | ||
on: push | ||
# Should be the same as ipldstore/run-checks.sh | ||
|
||
jobs: | ||
run_checks: | ||
name: Create project environment, run all checks | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Create project environment | ||
run: uv sync | ||
|
||
- name: Run pytest with coverage | ||
run: uv run pytest --cov=py_hamt tests/ | ||
|
||
- name: Check coverage | ||
run: uv run coverage report --fail-under=100 --show-missing | ||
|
||
- name: Check linting with ruff | ||
run: uv run ruff check | ||
|
||
- name: Check formatting with ruff | ||
run: uv run ruff format --check |
This file was deleted.
Oops, something went wrong.