From ab27f4318aa19ee4e17cf2d22a0874e012575c0b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 18 Feb 2025 14:56:49 +0800 Subject: [PATCH] Add Github CI config. --- .github/dependabot.yml | 18 ++++++ .github/workflows/ci.yml | 68 +++++++++++++++++++++ .github/workflows/config-file-deps-bump.yml | 12 ++++ .github/workflows/pre-commit-update.yml | 12 ++++ 4 files changed, 110 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/config-file-deps-bump.yml create mode 100644 .github/workflows/pre-commit-update.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3b302bb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates on Sunday, 8PM UTC + interval: "weekly" + day: "sunday" + time: "20:00" + + - package-ecosystem: "pip" + directory: "/" + schedule: + # Check for updates on Sunday, 8PM UTC + interval: "weekly" + day: "sunday" + time: "20:00" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6e12080 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI +on: + pull_request: + push: + branches: + - main + +# Cancel active CI runs for a PR before starting another run +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash # https://github.com/beeware/briefcase/pull/912 + +env: + FORCE_COLOR: "1" + +jobs: + pre-commit: + name: Pre-commit checks + uses: beeware/.github/.github/workflows/pre-commit-run.yml@main + + unit-tests: + name: Unit tests + needs: [ pre-commit ] + runs-on: ${{ matrix.platform }} + continue-on-error: ${{ matrix.experimental || false }} + strategy: + fail-fast: false + matrix: + platform: [ "macos-13", "macos-latest", "windows-latest", "ubuntu-24.04" ] + python-version: [ "3.9", "3.13", ] + include: + # Ensure the Python versions between min and max are tested + - platform: "ubuntu-24.04" + python-version: "3.10" + - platform: "ubuntu-24.04" + python-version: "3.11" + - platform: "ubuntu-24.04" + python-version: "3.12" + # Allow dev Python to fail without failing entire job + - platform: "ubuntu-24.04" + python-version: "3.14" + experimental: true + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5.4.0 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Install Tox + uses: beeware/.github/.github/actions/install-requirement@main + with: + requirements: tox + extra: dev + + - name: Test + id: test + run: | + tox -e py diff --git a/.github/workflows/config-file-deps-bump.yml b/.github/workflows/config-file-deps-bump.yml new file mode 100644 index 0000000..5a9040b --- /dev/null +++ b/.github/workflows/config-file-deps-bump.yml @@ -0,0 +1,12 @@ +name: Bump Config File Dependencies + +on: + schedule: + - cron: "0 20 * * SUN" # Sunday @ 2000 UTC + workflow_dispatch: + +jobs: + dep-bump-versions: + name: Bump Config File Dependencies + uses: beeware/.github/.github/workflows/dep-version-bump.yml@main + secrets: inherit diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml new file mode 100644 index 0000000..2a8038c --- /dev/null +++ b/.github/workflows/pre-commit-update.yml @@ -0,0 +1,12 @@ +name: Update pre-commit + +on: + schedule: + - cron: "0 20 * * SUN" # Sunday @ 2000 UTC + workflow_dispatch: + +jobs: + pre-commit-update: + name: Update pre-commit + uses: beeware/.github/.github/workflows/pre-commit-update.yml@main + secrets: inherit