-
Notifications
You must be signed in to change notification settings - Fork 11
82 lines (76 loc) · 2.29 KB
/
rcc.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
name: "RCC"
on:
workflow_call: {}
env:
RCC_REF: "v17.29.1_micromamba_v1.5.8_from_github" # Update omd/Licenses.csv in the Checkmk repo when changing this.
GO_VERSION: "1.23.x"
RUBY_VERSION: "2.7"
jobs:
analyse_changes:
if: always()
runs-on: ubuntu-latest
outputs:
rcc_yaml_changed: ${{ steps.filter.outputs.rcc_yaml }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rcc_yaml:
- '.github/workflows/rcc.yaml'
check_cache:
runs-on: ubuntu-latest
outputs:
cache_hit: ${{ steps.restore-from-cache.outputs.cache-hit }}
steps:
- id: restore-from-cache
uses: actions/cache/restore@v4
with:
key: rcc-${{ env.RCC_REF }}-${{ env.GO_VERSION }}-${{ env.RUBY_VERSION }}
path: build
lookup-only: true
build_and_cache:
runs-on: ubuntu-latest
needs:
- analyse_changes
- check_cache
if: ${{ (needs.analyse_changes.outputs.rcc_yaml_changed == 'true') || (needs.check_cache.outputs.cache_hit != 'true') }}
steps:
- uses: actions/checkout@v4
with:
repository: elabit/rcc
ref: ${{ env.RCC_REF }}
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
- run: CGO_ENABLED=0 rake build
- run: rake test
- run: file build/linux64/rcc | grep "statically linked"
- uses: actions/cache/save@v4
with:
key: rcc-${{ env.RCC_REF }}-${{ env.GO_VERSION }}-${{ env.RUBY_VERSION }}
path: build
upload:
runs-on: ubuntu-latest
needs:
- build_and_cache
# See https://github.com/actions/runner/issues/491 for the following condition
if: |
always() &&
(needs.build_and_cache.result == 'success' || needs.build_and_cache.result == 'skipped')
steps:
- uses: actions/cache/restore@v4
with:
path: build
key: rcc-${{ env.RCC_REF }}-${{ env.GO_VERSION }}-${{ env.RUBY_VERSION }}
fail-on-cache-miss: true
- uses: actions/upload-artifact@v4
with:
name: rcc
path: build/
if-no-files-found: error