2022-09-05 08:19:55 +08:00
|
|
|
name: Docker build
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
2022-11-11 14:23:02 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-11-23 02:21:40 +08:00
|
|
|
images: [ubuntu18.04, ubuntu20.04, ubuntu22.04, debian10, debian11, archlinux]
|
2022-11-11 14:23:02 +08:00
|
|
|
|
2022-09-05 08:19:55 +08:00
|
|
|
runs-on: ubuntu-latest
|
2022-11-11 14:23:02 +08:00
|
|
|
timeout-minutes: 30
|
2022-09-05 08:19:55 +08:00
|
|
|
steps:
|
2022-11-11 14:23:02 +08:00
|
|
|
- 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
|
2022-11-23 02:21:40 +08:00
|
|
|
key: ${{ matrix.images }}-cache-images-{hash}
|
2022-09-05 08:19:55 +08:00
|
|
|
|
2022-11-11 14:23:02 +08:00
|
|
|
- name: Docker Build ${{ matrix.images }}
|
|
|
|
run: docker-compose pull ${{ matrix.images }}
|
2022-09-05 08:19:55 +08:00
|
|
|
|
2022-11-11 14:23:02 +08:00
|
|
|
- name: Test on ${{ matrix.images }}
|
|
|
|
run: docker-compose run ${{ matrix.images }} ./tests.sh
|