Skip to content

Commit

Permalink
fix: reduce duplication of setup process
Browse files Browse the repository at this point in the history
  • Loading branch information
dlstadther committed Aug 24, 2024
1 parent 3e60ab7 commit 699a3a6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 71 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,18 @@ on:
workflow_dispatch:

jobs:
setup:
uses: ./.github/workflows/setup.yml

build:
needs:
- setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: 3.x

- name: "Configure git"
run: |
git config user.name "CICD"
git config user.email "cicd@github.com"
- name: "Install dependencies"
run: |
make init-uv
make install
- name: "Build mkdocs"
run: make doc-deploy
20 changes: 20 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup

on:
workflow_call:

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
make init-uv
make install
73 changes: 13 additions & 60 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,96 +8,49 @@ on:
- develop

jobs:
setup:
uses: ./.github/workflows/setup.yml

format:
needs:
- setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
make init-uv
make install
- name: Format checking with Ruff Format
run: make format

lint:
needs:
- setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
make init-uv
make install
- name: Lint with Ruff
run: make lint-python

- name: Lint with Sqlfluff
run: make lint-sql

type-check:
needs:
- setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
make init-uv
make install
- name: Type checking with Mypy
run: make type

test:
needs:
- setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
make init-uv
make install
- name: Test with pytest
run: make test

build:
needs:
- setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
make init-uv
make install
- name: Verify build
run: make build

Expand Down

0 comments on commit 699a3a6

Please sign in to comment.