Some checks failed
- Replaced `GITEA_PATH` with `GITHUB_PATH` in CI workflow files. - This corrects the environment variable used for adding Cargo's bin directory to the PATH. - Ensures the workflow functions correctly within the GitHub Actions environment.
107 lines
2.6 KiB
YAML
107 lines
2.6 KiB
YAML
name: CI + Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install uv
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Run Ruff
|
|
run: |
|
|
uv venv .venv
|
|
source .venv/bin/activate
|
|
uv run ruff check
|
|
uv run ruff format --check
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
needs: lint
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install uv
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Run Tests
|
|
run: |
|
|
uv venv .venv
|
|
source .venv/bin/activate
|
|
uv run pytest -v --cov=. --cov-report=xml
|
|
|
|
- name: Upload to Codecov
|
|
run: bash <(curl -s https://codecov.io/bash)
|
|
|
|
deploy_to_pypi:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
if: github.ref == 'refs/heads/master'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install uv
|
|
run: |
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Publish to PyPI
|
|
env:
|
|
TWINE_USERNAME: __token__
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
run: |
|
|
uv venv .venv
|
|
source .venv/bin/activate
|
|
uv pip install build twine
|
|
uv run python -m build
|
|
uv run python -m twine upload dist/*
|
|
|
|
deploy_to_dockerhub:
|
|
runs-on: ubuntu-latest
|
|
needs: [deploy_to_pypi]
|
|
if: github.ref == 'refs/heads/master'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Log in to DockerHub
|
|
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Build and push to DockerHub
|
|
run: |
|
|
docker buildx build --push \
|
|
--tag rogsme/subscleaner:latest \
|
|
.
|
|
|
|
deploy_to_gitea:
|
|
runs-on: ubuntu-latest
|
|
needs: [deploy_to_pypi]
|
|
if: github.ref == 'refs/heads/master'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Log in to Gitea Registry
|
|
run: echo "${{ vars.REPOSITORY_TOKEN }}" | docker login git.rogs.me -u rogs --password-stdin
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Build and push to Gitea
|
|
run: |
|
|
docker buildx build --push \
|
|
--tag git.rogs.me/rogs/subscleaner:latest \
|
|
.
|