Skip to content

Commit 6300c6d

Browse files
committed
Refresh build and test
1 parent 46c581e commit 6300c6d

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
name: Build docker image
2-
1+
name: Build and test container
32
on: [push]
43

54
jobs:
6-
build-action:
5+
build:
76
runs-on: ubuntu-latest
87
steps:
98
- name: Checkout repository
109
uses: actions/checkout@v3
11-
- name: Build action image
10+
# https://github.com/docker/setup-qemu-action
11+
- name: Set up QEMU
12+
uses: docker/setup-qemu-action@v1
13+
# https://github.com/docker/setup-buildx-action
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v1
16+
- name: Build image
1217
run: make docker-build
18+
env:
19+
DOCKER_BUILDKIT: 1
20+
- name: Test image
21+
run: make test

Makefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
1+
IMAGE_TAG ?= docker-phpunit
2+
3+
# All: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
4+
PLATFORM ?= linux/amd64
5+
6+
ACTION ?= load
7+
PROGRESS_MODE ?= plain
8+
19
.PHONY: update-tags docker-build
210

311
docker-build:
4-
docker build ./docker \
12+
# https://github.com/docker/buildx#building
13+
docker buildx build \
514
--build-arg VCS_REF=`git rev-parse HEAD` \
6-
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
15+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
16+
--tag $(IMAGE_TAG) \
17+
--progress $(PROGRESS_MODE) \
18+
--platform $(PLATFORM) \
19+
--pull \
20+
--$(ACTION) \
21+
./docker
22+
23+
docker-test:
24+
docker run --rm ${IMAGE_TAG} --version
25+
docker run --rm ${IMAGE_TAG} --help
726

827
update-tags:
928
git checkout 7

0 commit comments

Comments
 (0)