Skip to content
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

Bugfix/cleanup GitHub actions #990

Merged
merged 8 commits into from
Oct 29, 2024
13 changes: 4 additions & 9 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"schedule": ["before 2am"],
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"labels": ["dependencies"],
"labels": ["dependencies", "no-stale"],
"lockFileMaintenance": {
"enabled": true,
"automerge": true
Expand All @@ -21,28 +21,23 @@
},
{
"matchManagers": ["poetry"],
"matchDepTypes": ["dev"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchManagers": ["npm", "nvm"],
"addLabels": ["javascript"],
"stabilityDays": 3,
"rangeStrategy": "pin",
"automerge": true
"rangeStrategy": "pin"
},
{
"matchManagers": ["npm"],
"matchManagers": ["npm", "nvm"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchManagers": ["github-actions"],
"addLabels": ["github_actions"],
"stabilityDays": 3,
"rangeStrategy": "pin",
"pinDigests": true
"rangeStrategy": "pin"
},
{
"matchManagers": ["github-actions"],
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Initialize CodeQL
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3
uses: github/codeql-action/init@v3.27.0
- name: 🚀 Perform CodeQL Analysis
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3
uses: github/codeql-action/analyze@v3.27.0
4 changes: 2 additions & 2 deletions .github/workflows/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🚀 Run Label Syncer
uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75 changes: 26 additions & 49 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ on:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.11"

jobs:
codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
Expand All @@ -39,61 +39,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run Ruff
run: poetry run ruff check .

black:
name: black
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run black on docs
run: poetry run blacken-docs
- name: 🚀 Run ruff linter
run: poetry run ruff check --output-format=github .
- name: 🚀 Run ruff formatter
run: poetry run ruff format --check .

pre-commit-hooks:
name: pre-commit-hooks
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
Expand All @@ -117,8 +96,6 @@ jobs:
- name: 🚀 Check TOML files
run: poetry run pre-commit run check-toml --all-files
- name: 🚀 Check XML files
run: poetry run pre-commit run check-xml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
Expand All @@ -134,15 +111,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
Expand All @@ -157,15 +134,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
Expand All @@ -180,26 +157,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🏗 Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
uses: actions/setup-node@v4.1.0
with:
node-version-file: '.nvmrc'
cache: 'npm'
node-version-file: ".nvmrc"
cache: "npm"
- name: 🏗 Install NPM dependencies
run: npm install
- name: 🚀 Run prettier
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: 🔒 Lock closed issues and PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
- uses: dessant/[email protected]
with:
github-token: ${{ github.token }}
issue-inactive-days: "30"
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/pr-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ name: PR Labels

# yamllint disable-line rule:truthy
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
pull_request_target:
types:
- opened
- labeled
- unlabeled
- synchronize
workflow_call:

jobs:
pr_labels:
name: Verify
runs-on: ubuntu-latest
steps:
- name: 🏷 Verify PR has a valid label
uses: jesusvasquez333/verify-pr-label-action@657d111bbbe13e22bbd55870f1813c699bde1401 # v1.4.0
uses: jesusvasquez333/[email protected]
with:
pull-request-number: "${{ github.event.pull_request.number }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
valid-labels: >-
breaking-change, bugfix, documentation, enhancement,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚀 Run Release Drafter
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 18 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@ on:
- published

env:
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.11"

jobs:
release:
name: Releasing to PyPi
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/bsblan
permissions:
contents: write
id-token: write
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
uses: actions/checkout@v4.2.2
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: 'poetry'
Expand All @@ -40,8 +46,12 @@ jobs:
- name: 🏗 Build package
run: poetry build --no-interaction
- name: 🚀 Publish to PyPi
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi "${PYPI_TOKEN}"
poetry publish --no-interaction
uses: pypa/[email protected]
with:
verbose: true
print-hash: true
- name: ✍️ Sign published artifacts
uses: sigstore/[email protected]
with:
inputs: ./dist/*.tar.gz ./dist/*.whl
release-signing-artifacts: true
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚀 Run stale
uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
Expand Down
Loading
Loading