forked from CESNET/ipfixprobe
-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (115 loc) · 3.54 KB
/
stage0.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
name: prepare
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
build_docker_image:
strategy:
matrix:
os: [oraclelinux-9, oraclelinux-8, rockylinux-8]
steps:
- name: IMAGE OS info
run: echo ${{ matrix.os }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_LOGIN }}
- name: Extract metadata (tags, labels) for Docker
run: |
IFS=- read -r OS_NAME OS_TAG <<< ${{ matrix.os }}
echo "${{ matrix.os }}_OS_NAME=$OS_NAME" >>${GITHUB_ENV}
echo "${{ matrix.os }}_OS_TAG=$OS_TAG" >>${GITHUB_ENV}
- name: env VALUE
run: |
echo ${{ env. }}${{ matrix.os }}_OS_NAME
echo ${{ env. }}${{ matrix.os }}_OS_TAG
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
build-args: |
OS_DISTRO=oraclelinux
OS_RELEASE=9
push: true
tags: ghcr.io/siskapavel/oraclelinux:ol9
cache-from: type=gha
cache-to: type=gha,mode=max
runs-on: ubuntu-latest
docker-image-ol9:
runs-on: ubuntu-latest
steps:
- name: set lower case owner name
run: |
echo "ACTOR_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.actor }}'
- uses: actions/checkout@v4
- name: basic info
run: |
echo ${{ ENV.ACTOR_LC }}
echo ${{ github.repository }}
echo ${{ github.actor }}
echo ${{ steps.meta.outputs.tags }}
echo ${{ steps.meta.outputs.labels }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_LOGIN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images:
ghcr.io/${{ github.actor }}/oraclelinux:ol9
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
build-args: |
OS_DISTRO=oraclelinux
OS_RELEASE=9
push: true
tags: ghcr.io/siskapavel/oraclelinux:ol9
cache-from: type=gha
cache-to: type=gha,mode=max
test_stage:
runs-on: ubuntu-latest
needs: docker-image-ol9
container:
image: ghcr.io/siskapavel/oraclelinux:ol9
steps:
- uses: actions/checkout@v3
- name: Check clang-format
run: find . -type f -regextype posix-egrep -regex '.*.(hpp|cpp)$' -print0 | xargs -0 clang-format --dry-run --Werror --style=file
build_stage:
runs-on: ubuntu-latest
needs: test_stage
container:
image: ghcr.io/siskapavel/oraclelinux:ol9
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: autoreconf
run: autoreconf -i
- name: configure
run: ./configure --with-raw --with-pcap
- name: make
run: make
- name: make rpm
run: make rpm