mirror of
https://github.com/pi-hole/docker-pi-hole.git
synced 2026-04-26 19:55:20 +01:00
Major overhaul of the test suite
Signed-off-by: yubiuser <github@yubiuser.dev>
This commit is contained in:
51
.github/workflows/build-and-test.yml
vendored
51
.github/workflows/build-and-test.yml
vendored
@@ -3,30 +3,49 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
build-and-test:
|
||||
runs-on: ${{ matrix.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Official docker images for docker are only available for amd64 and arm64
|
||||
# TODO: Look at: https://github.com/docker-library/official-images#architectures-other-than-amd64
|
||||
# Is testing on all platforms really necessary?
|
||||
# Disabled arm64 tests for the time being, something is wrong with the test config and the volumes are getting shared between the test containers on different architectures
|
||||
#platform: [linux/amd64, linux/arm64]
|
||||
platform: [linux/amd64]
|
||||
include:
|
||||
- platform: linux/amd64
|
||||
runner: ubuntu-latest
|
||||
- platform: linux/386
|
||||
runner: ubuntu-latest
|
||||
- platform: linux/arm/v6
|
||||
runner: ubuntu-24.04-arm
|
||||
- platform: linux/arm/v7
|
||||
runner: ubuntu-24.04-arm
|
||||
- platform: linux/arm64
|
||||
runner: ubuntu-24.04-arm
|
||||
- platform: linux/riscv64
|
||||
runner: ubuntu-24.04-arm
|
||||
env:
|
||||
CI_ARCH: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
platforms: ${{ matrix.platform }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Run Tests
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Run black formatter
|
||||
run: |
|
||||
echo "Building image to test"
|
||||
PLATFORM=${{ matrix.platform }} ./build-and-test.sh
|
||||
pip install black
|
||||
black --check --diff test/tests/
|
||||
|
||||
- name: Install wheel
|
||||
run: pip install wheel
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install -r test/requirements.txt
|
||||
|
||||
- name: Test with tox
|
||||
run: |
|
||||
CIPLATFORM=${{ env.CI_ARCH }} tox -c test/tox.ini
|
||||
|
||||
Reference in New Issue
Block a user