Adding Gitea CI/CD #1
@@ -6,64 +6,89 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 9 * * 1" # weekly Monday 9am
|
- cron: "0 9 * * 1"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
install:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: python:3.13-slim
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install system dependencies
|
|
||||||
run: apt-get update -qq && apt-get install -y -qq libcap-dev
|
|
||||||
|
|
||||||
- name: Install Poetry
|
|
||||||
run: pip install poetry==2.1.1
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: poetry install --without pi --no-interaction
|
|
||||||
|
|
||||||
- name: Cache venv
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: .venv
|
|
||||||
key: venv-${{ hashFiles('pyproject.toml') }}
|
|
||||||
|
|
||||||
black:
|
black:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: python:3.13-slim
|
container: python:3.13-slim
|
||||||
needs: install
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- run: pip install poetry==2.1.1
|
run: |
|
||||||
- run: poetry run black --check src/ tests/
|
apt-get update -qq && apt-get install -y -qq git
|
||||||
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: apt-get install -y -qq libcap-dev
|
||||||
|
|
||||||
|
- name: Install Poetry and dependencies
|
||||||
|
run: |
|
||||||
|
pip install poetry==2.1.1
|
||||||
|
poetry install --without pi --no-interaction
|
||||||
|
|
||||||
|
- name: Run black
|
||||||
|
run: poetry run black --check src/ tests/
|
||||||
|
|
||||||
ruff:
|
ruff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: python:3.13-slim
|
container: python:3.13-slim
|
||||||
needs: install
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- run: pip install poetry==2.1.1
|
run: |
|
||||||
- run: poetry run ruff check src/ tests/
|
apt-get update -qq && apt-get install -y -qq git
|
||||||
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: apt-get install -y -qq libcap-dev
|
||||||
|
|
||||||
|
- name: Install Poetry and dependencies
|
||||||
|
run: |
|
||||||
|
pip install poetry==2.1.1
|
||||||
|
poetry install --without pi --no-interaction
|
||||||
|
|
||||||
|
- name: Run ruff
|
||||||
|
run: poetry run ruff check src/ tests/
|
||||||
|
|
||||||
mypy:
|
mypy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: python:3.13-slim
|
container: python:3.13-slim
|
||||||
needs: install
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- run: pip install poetry==2.1.1
|
run: |
|
||||||
- run: poetry run mypy src/
|
apt-get update -qq && apt-get install -y -qq git
|
||||||
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: apt-get install -y -qq libcap-dev
|
||||||
|
|
||||||
|
- name: Install Poetry and dependencies
|
||||||
|
run: |
|
||||||
|
pip install poetry==2.1.1
|
||||||
|
poetry install --without pi --no-interaction
|
||||||
|
|
||||||
|
- name: Run mypy
|
||||||
|
run: poetry run mypy src/
|
||||||
|
|
||||||
pytest:
|
pytest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: python:3.13-slim
|
container: python:3.13-slim
|
||||||
needs: install
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- run: apt-get update -qq && apt-get install -y -qq libcap-dev
|
run: |
|
||||||
- run: pip install poetry==2.1.1
|
apt-get update -qq && apt-get install -y -qq git
|
||||||
- run: poetry install --without pi --no-interaction
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
||||||
- run: poetry run pytest
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: apt-get install -y -qq libcap-dev
|
||||||
|
|
||||||
|
- name: Install Poetry and dependencies
|
||||||
|
run: |
|
||||||
|
pip install poetry==2.1.1
|
||||||
|
poetry install --without pi --no-interaction
|
||||||
|
|
||||||
|
- name: Run pytest
|
||||||
|
run: poetry run pytest
|
||||||
|
|||||||
@@ -10,21 +10,21 @@ jobs:
|
|||||||
dependency-update:
|
dependency-update:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: python:3.13-slim
|
container: python:3.13-slim
|
||||||
# skip if this is already a dependency update branch
|
|
||||||
if: "!startsWith(github.ref, 'refs/heads/dependency-updates-')"
|
if: "!startsWith(github.ref, 'refs/heads/dependency-updates-')"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
with:
|
run: |
|
||||||
token: ${{ secrets.CI_TOKEN }}
|
apt-get update -qq && apt-get install -y -qq git curl
|
||||||
|
git clone ${{ github.server_url }}/${{ github.repository }} .
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: apt-get update -qq && apt-get install -y -qq libcap-dev git curl
|
run: apt-get install -y -qq libcap-dev
|
||||||
|
|
||||||
- name: Install Poetry
|
- name: Install Poetry and dependencies
|
||||||
run: pip install poetry==2.1.1
|
run: |
|
||||||
|
pip install poetry==2.1.1
|
||||||
- name: Install dependencies
|
poetry install --without pi --no-interaction
|
||||||
run: poetry install --without pi --no-interaction
|
|
||||||
|
|
||||||
- name: Run dependency update check
|
- name: Run dependency update check
|
||||||
id: update
|
id: update
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
CI_TOKEN: ${{ secrets.CI_TOKEN }}
|
CI_TOKEN: ${{ secrets.CI_TOKEN }}
|
||||||
CI_SERVER_URL: ${{ secrets.CI_SERVER_URL }}
|
CI_SERVER_URL: ${{ secrets.CI_SERVER_URL }}
|
||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
ASSIGNEE_ID: ${{ secrets.CI_ASSIGNEE_ID }}
|
CI_ASSIGNEE_ID: ${{ secrets.CI_ASSIGNEE_ID }}
|
||||||
run: |
|
run: |
|
||||||
chmod +x scripts/create_pr_gitea.sh
|
chmod +x scripts/create_pr_gitea.sh
|
||||||
bash scripts/create_pr_gitea.sh
|
bash scripts/create_pr_gitea.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user