-
Notifications
You must be signed in to change notification settings - Fork 36
153 lines (124 loc) · 3.76 KB
/
pull-request-check.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#
# Copyright (c) 2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: Pull Request Check
# Trigger the workflow on pull request
on: [pull_request]
jobs:
build:
name: build
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
dist: ['libc-ubi8', 'libc-ubi9', 'musl']
arch: ['amd64']
steps:
- name: Checkout che-code source code
uses: actions/checkout@v4
- name: Cleanup docker images
run: |
docker system prune -af
- name: Compile che-code
run: |
docker buildx build \
--platform linux/${{matrix.arch}} \
--progress=plain \
-f build/dockerfiles/linux-${{matrix.dist}}.Dockerfile \
-t linux-${{matrix.dist}}-${{matrix.arch}} .
- name: Display docker images
run: |
docker images
- name: Compress image to a file
run: |
docker save linux-${{matrix.dist}}-${{matrix.arch}} | gzip > linux-${{matrix.dist}}-${{matrix.arch}}.tgz
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: linux-${{matrix.dist}}-${{matrix.arch}}
path: linux-${{matrix.dist}}-${{matrix.arch}}.tgz
assemble:
name: assemble
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout che-code source code
uses: actions/checkout@v4
- name: Cleanup docker images
run: |
docker system prune -af
- name: Download editor artifacts
uses: actions/download-artifact@v4
with:
pattern: linux-*
merge-multiple: true
path: .
- name: List downloaded files
run: |
ls -lah
- name: Load docker images
run: |
docker load -i linux-libc-ubi8-amd64.tgz
docker load -i linux-libc-ubi9-amd64.tgz
docker load -i linux-musl-amd64.tgz
- name: Display docker images
run: |
docker images
- name: Assemble che-code
run: |
docker buildx build \
--platform linux/amd64 \
--progress=plain \
-f build/dockerfiles/assembly.Dockerfile \
-t che-code .
- name: Display docker images
run: |
docker images
- name: Compress image to a file
run: |
docker save che-code | gzip > che-code.tgz
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: che-code
path: che-code.tgz
- name: Store PR info
run: |
echo "${{ github.event.number }}" > PR_NUMBER
- name: Upload PR Number artifact
uses: actions/upload-artifact@v4
with:
name: pull-request-number
path: PR_NUMBER
dev:
name: build-che-dev-image
runs-on: ubuntu-22.04
steps:
- name: Checkout che-code source code
uses: actions/checkout@v4
- name: Cleanup docker images
run: |
docker system prune -af
- name: Build Che-Code Docker image
run: |
docker buildx build \
--platform linux/amd64 \
--progress=plain \
-f build/dockerfiles/dev.Dockerfile \
-t che-dev .
- name: Display docker images
run: |
docker images
- name: Compress che-dev image to a file
run: |
docker save che-dev | gzip > che-dev.tgz
- name: Upload che-dev docker image artifact
uses: actions/upload-artifact@v4
with:
name: che-dev
path: che-dev.tgz