-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (92 loc) · 2.3 KB
/
Copy pathci.yaml
File metadata and controls
101 lines (92 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Continuous Integration
on:
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- .github/workflows/ci.yaml
- rootfs/**
- tests/**
- .dockerignore
- compose.yaml
- Dockerfile
push:
branches:
- main
paths:
- .github/workflows/ci.yaml
- rootfs/**
- .dockerignore
- compose.yaml
- Dockerfile
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
packages: read
services:
registry:
image: registry:2
ports:
- 5000:5000
strategy:
fail-fast: false
matrix:
php:
- 8.3
- 8.4
- 8.5
steps:
- name: Check Out
uses: actions/checkout@v7
- name: Login to Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: nayleen
password: ${{ secrets.GITHUB_TOKEN }}
- name: Export PHP version to ENV
run: echo "PHP_VERSION=${{ matrix.php }}" >> $GITHUB_ENV
- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v4
with:
driver-opts: network=host
- name: Build Local Image
uses: docker/build-push-action@v7
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
build-args: "PHP_VERSION=${{ matrix.php }}"
cache-from: type=registry,ref=ghcr.io/nayleen/php:${{ matrix.php }}-amd64-cache
context: .
load: true
push: true
tags: "localhost:5000/php:${{ matrix.php }}"
- name: Test Local Images
env:
REGISTRY: localhost:5000
run: |
# assume each subfolder of ./tests is a test suite and run it
for test in $(find ./tests/* -type d); do
cd $test && ./run.sh
cd - > /dev/null
done
release:
if: ${{ github.event_name == 'push' }}
needs: test
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Build Release Images
uses: benc-uk/workflow-dispatch@v1
with:
workflow: build-all.yaml