-
Notifications
You must be signed in to change notification settings - Fork 86
48 lines (40 loc) · 1.35 KB
/
test-build.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
---
name: build dnf5 with ccache to check for quick build errors
on:
pull_request:
workflow_dispatch:
jobs:
build-with-ccache:
runs-on: ubuntu-latest
container:
image: fedora:rawhide
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
dnf install -y cmake ccache gcc-c++ libtoml toml11-devel
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v3
with:
path: .ccache${{github.workspace}}
key: ${ { matrix.config.name } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } }
restore-keys: |
${ { matrix.config.name } }-ccache-
- name: Create ccache symlinks to prioritize it over gcc
run: |
ln -s /usr/bin/ccache /usr/local/bin/gcc
ln -s /usr/bin/ccache /usr/local/bin/g++
ln -s /usr/bin/ccache /usr/local/bin/cc
ln -s /usr/bin/ccache /usr/local/bin/c++
- name: Configure cmake
run: cmake -S . -B build
- name: Build dnf5
run: cmake --build build