-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (55 loc) · 1.5 KB
/
ci.yaml
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
---
name: CI
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches: [main, devel]
tags:
- 'v*.*.*'
pull_request:
branches: [main, devel]
env:
REGISTRY: ghcr.io
IMAGE_BASE_NAME: ${{ github.repository_owner }}/dse
PACKAGE_VERSION: 0.0.2
package_name: CLib
build_dir: null # Disables package generation (code only repo).
test_make_target: test
CCACHE_SECONDARY_STORAGE: ${{ secrets.CCACHE_SECONDARY_STORAGE }}
jobs:
build:
runs-on: [ubuntu-latest]
needs: []
strategy:
matrix:
package_arch:
- linux-amd64
container:
image: ghcr.io/boschglobal/dse-gcc-builder:main
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build package metadata
id: package_meta
uses: docker/metadata-action@v4
with:
images: dse/clib
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Get package version
if: startsWith(github.ref, 'refs/tags/')
id: package
run: |
echo "PACKAGE_VERSION=${{ fromJSON(steps.package_meta.outputs.json).labels['org.opencontainers.image.version'] }}" >> $GITHUB_ENV
- name: Build
env:
PACKAGE_ARCH: ${{ matrix.package_arch }}
run: |
make
- name: Test
if: ${{ env.test_make_target != '' }}
env:
PACKAGE_ARCH: ${{ matrix.package_arch }}
run: |
make ${{ env.test_make_target }}