Skip to content

Commit

Permalink
feat: publish now triggers and requires tests and quality
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Kowal committed Oct 25, 2024
1 parent d70b868 commit b6df3d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 32 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Code Quality

on:
workflow_dispatch:
push:
branches: ['main']
workflow_call:
pull_request:
branches: ['main']

Expand Down
31 changes: 5 additions & 26 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,14 @@ on:
types: [created]

jobs:
setup:
runs-on: ubuntu-latest
code_quality:
uses: ./.github/workflows/code_quality.yml

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12" # Cached by GitHub (https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#python)
cache: "pip"
cache-dependency-path: |
./uv.lock
- name: Cache venv
id: cache-venv
uses: actions/cache@v3
with:
path: .venv
key: python-3-12-venv-${{ hashFiles('./uv.lock') }}

- name: Install dependencies
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
run: |
python -m pip install --upgrade pip
pip install uv
uv sync --frozen
tests:
uses: ./.github/workflows/tests.yml

deploy:
needs: setup
needs: [code_quality, tests]
runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Tests

on:
workflow_dispatch:
push:
branches: ['main']
workflow_call:
pull_request:
branches: ['main']

Expand Down

0 comments on commit b6df3d7

Please sign in to comment.