diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b34481e..c16b826 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,36 +1,14 @@ -name: Test, Build, and Push Docker image +name: Build and Push Docker image on: - pull_request: - push: + workflow_run: + workflows: ["Test"] + types: [completed] branches: [main] jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install uv - uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version-file: .python-version - - - name: Install dependencies - run: uv sync --frozen - - - name: Run tests - run: uv run pytest - build-push: - needs: test - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8cfe081 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +name: Test + +on: + pull_request: + push: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + enable-cache: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: .python-version + + - name: Install dependencies + run: uv sync --frozen + + - name: Run tests + run: uv run pytest diff --git a/README.md b/README.md index 523e9b8..a0137af 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # rss-api -[![Tests](https://github.com/Skulldorom/rss-api/actions/workflows/docker.yml/badge.svg)](https://github.com/Skulldorom/rss-api/actions/workflows/docker.yml) +[![Tests](https://github.com/Skulldorom/rss-api/actions/workflows/test.yml/badge.svg)](https://github.com/Skulldorom/rss-api/actions/workflows/test.yml) +[![Docker](https://github.com/Skulldorom/rss-api/actions/workflows/docker.yml/badge.svg)](https://github.com/Skulldorom/rss-api/actions/workflows/docker.yml) Simple API to fetch rss feeds for github releases using fresh rss (powered by FastAPI)