From 7b5daa2f2f97563c2e143b98ea5cd36880187b84 Mon Sep 17 00:00:00 2001 From: trumully Date: Wed, 17 Apr 2024 12:12:17 +1200 Subject: [PATCH] ci: change workflow order --- .github/workflows/{lint.yml => ci.yml} | 28 ++++++++++++++++++--- .github/workflows/{main.yml => release.yml} | 24 +++--------------- 2 files changed, 28 insertions(+), 24 deletions(-) rename .github/workflows/{lint.yml => ci.yml} (60%) rename .github/workflows/{main.yml => release.yml} (81%) diff --git a/.github/workflows/lint.yml b/.github/workflows/ci.yml similarity index 60% rename from .github/workflows/lint.yml rename to .github/workflows/ci.yml index 1c857c7..1530adb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Lint +name: CI on: push: @@ -24,10 +24,30 @@ jobs: with: python-version: 3.12.1 poetry-version: 1.8.2 - - name: Run Linters + + - name: Run Ruff & Pylint run: | poetry install --only-root poetry run ruff check --fix src poetry run pylint src - poetry run mypy src - poetry run black src \ No newline at end of file + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Tests + run: | + poetry install --only-root + poetry run pytest + + + format: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Black + run: | + poetry run black src + \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/release.yml similarity index 81% rename from .github/workflows/main.yml rename to .github/workflows/release.yml index 637b71d..eecacbf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,9 @@ -name: Test & Release +name: Release on: workflow_run: - workflows: ["Lint"] + workflows: + - CI types: - completed workflow_dispatch: @@ -12,28 +13,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -jobs: - test: - name: Run Tests - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup Python & Dependencies - uses: packetcoders/action-setup-cache-python-poetry@main - with: - python-version: 3.12.1 - poetry-version: 1.8.2 - - name: Run Tests - run: | - poetry install --only-root - poetry run pytest - +jobs: release: name: Semantic Release runs-on: ubuntu-latest - needs: test if: github.ref == 'refs/heads/main' permissions: id-token: write