60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
name: Build and Test (EOL)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
tags-ignore:
|
|
- '*'
|
|
paths:
|
|
- 'eol/**'
|
|
pull_request:
|
|
paths:
|
|
- 'eol/**'
|
|
|
|
defaults:
|
|
run:
|
|
shell: 'bash -Eeuo pipefail -x {0}'
|
|
working-directory: eol
|
|
|
|
jobs:
|
|
generate-matrix:
|
|
name: Generate Matrix
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.generate.outputs.matrix }}
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- id: generate
|
|
name: Enumerate Dockerfiles
|
|
run: |
|
|
matrix="$(dirname */Dockerfile | sort -rn | jq -csR 'rtrimstr("\n") | split("\n") | { directory: . }')"
|
|
echo "::set-output name=matrix::$matrix"
|
|
build-image:
|
|
needs: generate-matrix
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
|
|
name: ${{ matrix.directory }}
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Clone docker-library/official-images (for testing)
|
|
run: |
|
|
git clone --depth 1 --single-branch https://github.com/docker-library/official-images.git
|
|
- name: Build image
|
|
run: |
|
|
docker version
|
|
dir='${{ matrix.directory }}'
|
|
img="perl:${dir//,/-}"
|
|
docker build -t "$img" "$dir"
|
|
- name: Inspect image creation and tag time
|
|
run: |
|
|
dir='${{ matrix.directory }}'
|
|
img="perl:${dir//,/-}"
|
|
docker image inspect --format '{{.Created}}' "$img"
|
|
docker image inspect --format '{{.Metadata.LastTagTime}}' "$img"
|
|
- name: Run tests
|
|
run: |
|
|
dir='${{ matrix.directory }}'
|
|
img="perl:${dir//,/-}"
|
|
./official-images/test/run.sh "$img"
|