Skip to content

Commit

Permalink
ci: Reorganize workflows (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
fkapsahili authored May 26, 2024
1 parent c2e50b2 commit b61e66e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 28 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build, lint and test

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
lint-and-test:
name: Build, lint and test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install hatch
run: |
python -m pip install hatch
- name: Lint
run: hatch run lint:check

- name: Tests
run: hatch run +py=${{ matrix.python-version }} test:test

- name: Build
run: hatch build
17 changes: 17 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint PR title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Lint PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v3.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 3 additions & 28 deletions .github/workflows/ci.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
name: "CI"
name: Release

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
branches:
- main

jobs:
lint-and-test:
name: Lint and Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install hatch
run: |
python -m pip install hatch
- name: Lint
run: hatch run lint:check

- name: Tests
run: hatch run +py=${{ matrix.python-version }} test:test

release:
name: Release
runs-on: ubuntu-latest
Expand Down

0 comments on commit b61e66e

Please sign in to comment.