Skip to content

Commit

Permalink
ci: codespell, stale, test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
janezlapajne committed Jun 29, 2024
1 parent c016069 commit 12760b0
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 12 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
27 changes: 15 additions & 12 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: Mark stale issues and pull requests

name: "Close stale issues"
on:
schedule:
- cron: "0 13 * * 1"
- cron: "0 0 * * *"

jobs:
stale:
name: Stale
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
days-before-stale: 30
days-before-close: 1
stale-issue-label: "stale :zzz:"
stale-issue-message: "This issue is stale. Remove stale label or it will be closed tomorrow."
stale-pr-label: "stale :zzz:"
stale-pr-message: "This PR is stale. Remove stale label or it will be closed tomorrow."
exempt-issue-labels: "in progress :construction:"
exempt-pr-labels: "in progress :construction:"
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "Issue is stale and will be closed in 14 days unless there is new activity"
stale-pr-message: "PR is stale and will be closed in 14 days unless there is new activity"
stale-issue-label: "stale"
exempt-issue-labels: "stale-exempt,kind/feature-request"
stale-pr-label: "stale"
exempt-pr-labels: "stale-exempt"
remove-stale-when-updated: "True"
operations-per-run: 500
days-before-stale: 180
days-before-close: 14
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test

on:
push:
branches: [develop, main]
pull_request:
branches: [develop, main]
types:
- opened
- synchronize
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install PDM
run: python -m pip install pdm
- name: Install dependencies with PDM
run: pdm install
- name: Run tests with coverage report
run: pdm run pytest --cov=./ --cov-report=html -m "not manual"
- name: Store coverage files
uses: actions/upload-artifact@v4
with:
name: coverage-html
path: htmlcov

# https://github.com/marketplace/actions/alls-green#why
alls-green: # This job does nothing and is only used for the branch protection
if: always()
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

0 comments on commit 12760b0

Please sign in to comment.