-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
name: DNF 5 Build | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-with-ccache: | ||
name: Build with CCache | ||
runs-on: ubuntu-latest | ||
container: | ||
image: fedora:rawhide | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# this step needs to be incorporated in our container that we use for testing | ||
- name: Install dependencies | ||
run: | | ||
dnf install -y ccache && dnf builddep -y ./dnf5.spec | ||
- name: Prepare CCache timestamp | ||
id: ccache_cache_timestamp | ||
run: | ||
echo "timestamp=$(date +%Y-%m-%d-%H:%M:%S)-UTC" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Cache CCache files | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/ccache | ||
key: ${{ github.event.repository.name }}-ccache-pr-${{ github.event.number }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | ||
restore-keys: | | ||
${{ github.event.repository.name }}-ccache-pr-${{ github.event.number }}- | ||
${{ github.event.repository.name }}-ccache-pr- | ||
${{ github.event.repository.name }}- | ||
- 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: Zero CCache statistics | ||
run: ccache -z | ||
|
||
- name: Configure DNF5 with CMake | ||
run: cmake -S . -B build | ||
|
||
- name: Build DNF5 | ||
run: cmake --build build | ||
|
||
- name: Display CCache statistics | ||
run: ccache -s |