This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
80 lines (69 loc) · 1.96 KB
/
pr-checks.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
#
# Copyright (c) 2020-2023 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: PR Checks
on:
pull_request:
branches:
- main
jobs:
shellcheck:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Shellcheck
run: |
find . -type f -name '*.sh' | wc -l
find . -type f -name '*.sh' | xargs shellcheck --external-sources
build-main-image:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare
id: prep
run: echo "platforms=$(cat PLATFORMS)" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Cache docker layers
uses: actions/cache@v3
with:
path: ./caches
key: v1-${{ github.head_ref }}
- name: Load docker layer cache
run: |
set +o pipefail
docker load -i ./caches/app.tar | true
- name: Build devfile registry
uses: docker/build-push-action@v4
with:
context: .
file: ./build/dockerfiles/Dockerfile
target: registry
platforms: ${{ steps.prep.outputs.platforms }}
tags: app
cache-from: "type=local,src=/tmp/.buildx-cache"
cache-to: "type=local,dest=/tmp/.buildx-cache"
push: false
provenance: false
- name: Build offline devfile registry
uses: docker/build-push-action@v4
with:
context: .
file: ./build/dockerfiles/Dockerfile
target: offline-registry
platforms: ${{ steps.prep.outputs.platforms }}
tags: app
cache-from: "type=local,src=/tmp/.buildx-cache"
push: false