-
-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (114 loc) · 4.29 KB
/
ci.yml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI
on:
pull_request:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- crystal_major_minor: '1.12'
crystal_full: '1.12.2'
target_platforms: linux/amd64,linux/arm64
concurrency_group: compile-crystal
- crystal_major_minor: '1.11'
crystal_full: '1.11.2'
target_platforms: linux/amd64,linux/arm64
concurrency_group: compile-crystal
# - crystal_major_minor: '1.10'
# crystal_full: '1.10.1'
# target_platforms: linux/amd64,linux/arm64
# concurrency_group: compile-crystal
# - crystal_major_minor: 1.9
# crystal_full: 1.9.2
# target_platforms: linux/amd64,linux/arm64
# concurrency_group: compile-crystal
# - crystal_major_minor: 1.8
# crystal_full: 1.8.2
# target_platforms: linux/amd64,linux/arm64
# concurrency_group: compile-crystal
# - crystal_major_minor: 1.7
# crystal_full: 1.7.3
# target_platforms: linux/amd64,linux/arm64
# concurrency_group: compile-crystal
# - crystal_major_minor: 1.6
# crystal_full: 1.6.2
# target_platforms: linux/amd64,linux/arm64
# concurrency_group: compile-crystal
# - crystal_major_minor: 1.5
# crystal_full: 1.5.1
# target_platforms: linux/amd64,linux/arm64
# concurrency_group: compile-crystal
# - crystal_major_minor: 1.4
# crystal_full: 1.4.1
# target_platforms: linux/amd64
# - crystal_major_minor: 1.3
# crystal_full: 1.3.2
# target_platforms: linux/amd64
# - crystal_major_minor: 1.2
# crystal_full: 1.2.2
# target_platforms: linux/amd64
name: >-
Crystal ${{ matrix.crystal_full }} (${{ matrix.crystal_major_minor }})
concurrency:
group: ${{ matrix.concurrency_group || format('{0}-{1}', github.run_id, matrix.crystal_full) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Define build number
run: |
echo "HYDROFOIL_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Docker GitHub Registry Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Metadata action
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
images: |
ghcr.io/luislavena/hydrofoil-crystal
tags: |
type=raw,${{ matrix.crystal_full }}
type=raw,${{ matrix.crystal_full }}-${{ env.HYDROFOIL_COMMIT }}
type=raw,${{ matrix.crystal_major_minor }}
- name: Setup Docker BuildKit cache strategy
uses: int128/docker-build-cache-config-action@v1
id: cache
with:
image: ghcr.io/${{ github.repository }}/build-cache
flavor: prefix=crystal-${{ matrix.crystal_major_minor }}--
- name: Build Docker images
uses: depot/build-push-action@v1
with:
project: ${{ secrets.DEPOT_PROJECT_ID }}
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
context: docker/${{ matrix.crystal_major_minor }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.target_platforms }}
push: ${{ github.event_name != 'pull_request' }}
cache-from: ${{ steps.cache.outputs.cache-from }}
cache-to: ${{ steps.cache.outputs.cache-to }}
# - name: Install Goss
# uses: e1himself/goss-installation-action@v1.0.4
# with:
# version: 'v0.3.16'
# - name: Test Docker image
# run: dgoss run local-image:ci sleep infinity
# FIXME: Use latest version of Dive
# - name: Analyze image efficiency
# uses: yuichielectric/dive-action@0.0.4
# with:
# image: local-image:ci
# config-file: ${{ github.workspace }}/.dive-ci.yml