Files
msys2-web/.github/workflows/main.yml
Christoph Reiter 4771731f2a Move to uv
2025-10-20 09:39:30 +02:00

52 lines
1.3 KiB
YAML

name: test
on: [push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade uv
uv sync
- name: Lint
run: |
uv run flake8
uv run mypy .
uv run reuse lint
- name: Test
run: |
uv run pytest
deploy:
permissions:
contents: read
packages: write
needs: [test]
runs-on: ubuntu-latest
if: (github.repository == 'msys2/msys2-web' && github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v4
- name: Log in
run: |
echo "$TOKEN" | docker login ghcr.io --username "$USERNAME" --password-stdin
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}
- name: Build image
run: |
docker build --tag ghcr.io/msys2/msys2-web:latest .
- name: Deploy image
run: |
docker push ghcr.io/msys2/msys2-web:latest