diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dc19991..17018dc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml new file mode 100644 index 0000000..d752bc0 --- /dev/null +++ b/.github/workflows/setup.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 44b012f..74ff133 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,39 +8,22 @@ 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 @@ -48,56 +31,26 @@ jobs: 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