-
-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (98 loc) · 3.49 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
name: CI
on:
pull_request:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- crystal_major_minor: 1.9
crystal_full: 1.9.0
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 }}
concurrency:
group: ${{ matrix.concurrency_group || format('{0}-{1}', github.run_id, matrix.crystal_full) }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Docker GitHub Registry Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Metadata action
id: meta
uses: docker/[email protected]
with:
flavor: |
latest=false
images: |
ghcr.io/luislavena/hydrofoil-crystal
tags: |
type=raw,${{ matrix.crystal_full }}
type=raw,${{ matrix.crystal_major_minor }}
- name: Setup Docker BuildKit cache strategy
uses: int128/[email protected]
id: cache
with:
image: ghcr.io/${{ github.repository }}/build-cache
tag-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/[email protected]
# 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/[email protected]
# with:
# image: local-image:ci
# config-file: ${{ github.workspace }}/.dive-ci.yml