Skip to content

Commit

Permalink
Merge pull request #1 from sajith/ci-housekeeping
Browse files Browse the repository at this point in the history
Ci housekeeping test
  • Loading branch information
sajith authored May 31, 2024
2 parents 630a720 + f3071f6 commit b895950
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 46 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- "main"
pull_request:
workflow_dispatch:

permissions:
contents: read
Expand All @@ -17,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: 'pip' # cache pip dependencies
Expand All @@ -41,7 +42,7 @@ jobs:
# See https://github.com/actions/upload-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: packages
path: dist/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,28 @@
# Run some code checks with GitHub Actions.

name: Code checks
name: Code formatting checks

on:
push:
branches:
- "main"
pull_request:
pull_request_target:

permissions:
contents: read
# Allow 1Password/check-signed-commits-action to leave comments on
# pull requests.
pull-requests: write
workflow_dispatch:

jobs:

checks:
runs-on: ubuntu-latest
steps:
- name: Check out sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # since we need to diff against origin/main.

# https://github.com/marketplace/actions/check-signed-commits-in-pr
# runs on pull_request_target and pull_request events, but
# pull_request_target is preferred because of the ability to
# leave comments on external PRs created from forks.
- name: Check that commits are signed
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: 1Password/check-signed-commits-action@v1

- name: Set up Python 3.9
uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.x"
cache: 'pip' # cache pip dependencies
cache-dependency-path: pyproject.toml

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/check_signed_commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# FABRIC policy requires that code commits are signed with the
# committer's GPG key.
#
# https://github.com/marketplace/actions/check-signed-commits-in-pr
# runs on pull_request_target events.

name: Check signed commits in PR
on: pull_request_target

jobs:
check-signed-commits:
name: Check signed commits in PR
runs-on: ubuntu-latest

permissions:
contents: read
# Allow 1Password/check-signed-commits-action to leave comments
# on pull requests.
pull-requests: write

steps:
- name: Check signed commits in PR
uses: 1Password/check-signed-commits-action@v1
with:
comment: |
⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (`git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}`) and force push them to this branch (`git push --force-with-lease`).
If you're new to commit signing, follow the steps below to set up commit signing with `gpg`:
1. [Generate a GPG key](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key)
2. [Add the GPG key to your GitHub account](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account)
3. [Configure `git` to use your GPG key for commit signing](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-gpg-key)
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:

steps:
- name: Check out sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: "3.9"
cache: 'pip'
cache-dependency-path: pyproject.toml

Expand Down
37 changes: 20 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- "main"
pull_request:
workflow_dispatch:
workflow_call:

jobs:
Expand All @@ -22,18 +23,21 @@ jobs:
- "3.10"
- "3.11"
os:
# See https://github.com/actions/runner-images for available
# runners.
- "ubuntu-22.04"
- "windows-2022"
- "macos-11"
- "macos-13" # Intel
- "macos-14" # ARM

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

steps:
- name: Check out sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
Expand All @@ -42,7 +46,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel coveralls
python -m pip install wheel
# # TODO: we can't use flake8 right now, because there isn't a
# # version of flake8 that can use pycodestyle==2.6.0, and fim has
Expand All @@ -59,24 +63,23 @@ jobs:
python -m pip install .[test]
python -m coverage run -m pytest
python -m coverage report
# Generate LCOV format coverage data for coveralls.
python -m coverage lcov -o coverage.lcov
- name: Send coverage data to coveralls.io
run: |
python -m coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{ join(matrix.*, '-') }}
file: coverage.lcov
parallel: true

finalize:
name: finalize
needs: test
runs-on: ubuntu-latest
container: python:3-slim
if: ${{ always() }}
steps:
- name: Indicate completion to coveralls.io
run: |
python -m pip --no-cache-dir install --upgrade coveralls
python -m coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ celerybeat.pid

# Environments
.env
.venv
.venv*
env/
venv/
venv*
ENV/
env.bak/
venv.bak/
Expand Down

0 comments on commit b895950

Please sign in to comment.