diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a2b027c88..f24669987 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,13 +3,26 @@ on: [push, pull_request] jobs: docker: + strategy: + fail-fast: false + matrix: + images: [ubuntu18.04, ubuntu20.04, ubuntu22.04, debian10, debian11] + runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 + + - name: Cache for docker images + uses: satackey/action-docker-layer-caching@v0.0.11 + # Ignore the failure of a step and avoid terminating the job. + continue-on-error: true + with: + path: ~/.cache/images + key: ${{ matrix.images }}-cache-images - - name: Build the Docker image - run: docker-compose build main + - name: Docker Build ${{ matrix.images }} + run: docker-compose pull ${{ matrix.images }} - - name: Run the tests in Docker - run: docker-compose run main ./tests.sh + - name: Test on ${{ matrix.images }} + run: docker-compose run ${{ matrix.images }} ./tests.sh diff --git a/Dockerfile b/Dockerfile index 02715de6e..d1b196a28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,9 @@ # For development, mount the directory so the host changes are reflected into container: # docker run -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v `pwd`:/pwndbg pwndbg bash # -FROM ubuntu:20.04 + +ARG image=ubuntu:20.04 +FROM $image WORKDIR /pwndbg diff --git a/docker-compose.yml b/docker-compose.yml index 18381602a..637b9c7af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ version: "3.8" services: - main: + main: &base-spec build: . volumes: - .:/pwndbg @@ -9,3 +9,38 @@ services: - seccomp:unconfined cap_add: - SYS_PTRACE + + ubuntu18.04: + <<: *base-spec + build: + context: . + args: + image: ubuntu:18.04 + + ubuntu20.04: + <<: *base-spec + build: + context: . + args: + image: ubuntu:20.04 + + ubuntu22.04: + <<: *base-spec + build: + context: . + args: + image: ubuntu:22.04 + + debian10: + <<: *base-spec + build: + context: . + args: + image: debian:10 + + debian11: + <<: *base-spec + build: + context: . + args: + image: debian:11