-
Notifications
You must be signed in to change notification settings - Fork 91
84 lines (76 loc) · 2.52 KB
/
test.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
#
# SPDX-License-Identifier: Apache-2.0
#
name: FPC test
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
- '.github/workflows/**'
pull_request:
paths-ignore:
- '**.md'
- '.github/workflows/**'
env:
DOCKER_REGISTRY: 'ghcr.io'
PUSH_TO_MAIN: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
jobs:
docker:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
os-version: 20.04
os-name: focal
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
docker:
- 'utils/docker/**'
- name: build dev image
if: steps.filter.outputs.docker == 'true'
env:
DOCKER_QUIET_BUILD: 1
run: |
DOCKER_BUILD_OPTS="--build-arg UBUNTU_VERSION=${{ matrix.os-version }} --build-arg UBUNTU_NAME=${{ matrix.os-name }}" \
make -C utils/docker build build-dev
- name: fetch dev image
if: steps.filter.outputs.docker == 'false'
env:
DOCKER_QUIET_BUILD: 1
run: |
DOCKER_BUILD_OPTS="--build-arg UBUNTU_VERSION=${{ matrix.os-version }} --build-arg UBUNTU_NAME=${{ matrix.os-name }}" \
make -C utils/docker pull pull-dev
- name: run make inside dev container
env:
DOCKER_DEV_CI_MODE: 1
DOCKER_QUIET_BUILD: 1
run: |
DOCKER_BUILD_OPTS="--build-arg UBUNTU_VERSION=${{ matrix.os-version }} --build-arg UBUNTU_NAME=${{ matrix.os-name }}" \
GOMODCACHE_PATH=$(go env GOMODCACHE) \
make -C utils/docker run-dev DOCKER_DEV_OPTIONAL_CMD='env IS_CI_RUNNING=true \
make all'
#
# continue only if we push to main and rebuild docker images
#
- name: Login to the ${{ env.DOCKER_REGISTRY }} Container Registry
if: env.PUSH_TO_MAIN == 'true' && steps.filter.outputs.docker == 'true'
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: publish images
if: env.PUSH_TO_MAIN == 'true' && steps.filter.outputs.docker == 'true'
run: |
make -C utils/docker publish