Skip to content

Commit

Permalink
Experiment around using a shared CI (#23)
Browse files Browse the repository at this point in the history
Co-authored-by: FasterSpeeding <FasterSpeeding@users.noreply.github.com>
Co-authored-by: always-on-duty[bot] <120557446+always-on-duty[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 24, 2022
1 parent c4a9091 commit ae97ed1
Show file tree
Hide file tree
Showing 34 changed files with 1,359 additions and 727 deletions.
17 changes: 9 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# ref: https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
versioning-strategy: increase-if-necessary
- package-ecosystem: "github-actions"
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
versioning-strategy: increase-if-necessary
39 changes: 14 additions & 25 deletions .github/workflows/freeze-for-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Freeze PR dev dep changes
name: Freeze PR dependency changes

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -8,13 +8,7 @@ on:
pull_request:
branches:
- master
paths:
- "dev-requirements/*.in"
- "!dev-requirements/constraints.in"

permissions:
contents: write
pull-requests: write
paths: ["piped", "dev-requirements/*.in", "!dev-requirements/constraints.in"]

jobs:
freeze-pr-dep-changes:
Expand All @@ -23,32 +17,27 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.ACTIONS_TOKEN || secrets.GITHUB_TOKEN }}

- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
ini_files:
- "dev-requirements/!(constraints).in"
list-files: escape
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: "true"

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.9"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Upgrade dev dependencies
run: python -m nox -s freeze-dev-deps -- ${{ steps.changes.outputs.ini_files_files}}
- name: Upgrade dependency locks
run: python -m nox -s freeze-locks bot-package-diff

- name: Add & Commit
uses: EndBug/add-and-commit@v9.1.1
- uses: actions/upload-artifact@v3
with:
message: "Upgrade PR dev dep changes"
name: gogo.patch
path: gogo.patch

- name: Check diff file
run: python -m nox -s is-diff-file-empty
47 changes: 47 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Lint

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "0 12 * * 6"
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: "true"

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Lint markup
run: python -m nox -s verify-markup

- name: Check spelling
run: python -m nox -s spell-check

- name: Lint with flake8
run: python -m nox -s flake8

- name: Check slotting
run: python -m nox -s slot-check
8 changes: 5 additions & 3 deletions .github/workflows/pr-docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy PR preview docs

concurrency:
group: preview-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
Expand All @@ -25,18 +25,20 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: "true"

- name: Set up Python 3.9
if: github.event.action != 'closed'
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.9"

- name: install prerequisites
if: github.event.action != 'closed'
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Build docs
if: github.event.action != 'closed'
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: "true"

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.9"

- name: Install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: publish
run: python -m nox -s publish
env:
FLIT_INDEX_URL: ${{ secrets.PYPI_TARGET }}
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
60 changes: 12 additions & 48 deletions .github/workflows/checks.yml → .github/workflows/py-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run checks
name: Run tests

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -16,57 +16,19 @@ on:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
- name: Lint markup
run: python -m nox -s verify-markup

- name: Lint with flake8
run: python -m nox -s flake8

- name: Check slotting
run: python -m nox -s slot-check

- name: Check spelling
run: python -m nox -s spell-check

- name: Run type checker
run: python -m nox -s type-check

- name: Run verify types
run: python -m nox -s verify-types

test:
py-test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- 3.9
- "3.10.5"
- 3.11
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.9, 3.10.5, 3.11]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: "true"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -76,7 +38,7 @@ jobs:
- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Run tests
run: |
Expand All @@ -90,16 +52,18 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: "true"

- name: Set up Python 3.9 # 10
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9" # 10
python-version: "3.9"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Record coverage
run: |
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/reformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,34 @@ on:
branches:
- master

permissions:
contents: write
pull-requests: write

jobs:
reformat:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.ACTIONS_TOKEN || secrets.GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
submodules: "true"

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.9"

- name: install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Reformat
run: python -m nox -s reformat
run: python -m nox -s reformat bot-package-diff

- name: Add & Commit
uses: EndBug/add-and-commit@v9.1.1
- uses: actions/upload-artifact@v3
with:
message: "Reformat"
name: gogo.patch
path: gogo.patch

- name: Check diff file
run: python -m nox -s is-diff-file-empty
7 changes: 5 additions & 2 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: "true"

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.9"

- name: Install prerequisites
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
python -m pip install -r ./piped/python/base-requirements/nox.txt
- name: Build docs
id: doc_info
Expand Down
Loading

0 comments on commit ae97ed1

Please sign in to comment.