Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ccache to speed up builds #90

Merged
merged 52 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3e81270
Add ccache to speed up builds
TrentHouliston Sep 22, 2023
2acc86d
Update for docker containers
TrentHouliston Sep 22, 2023
2738edf
Windows can't handle the split lines
TrentHouliston Sep 22, 2023
63e5fa1
Make the name nicer
TrentHouliston Sep 22, 2023
db1eeac
Remove double up
TrentHouliston Sep 22, 2023
83afa35
clang-tidy
TrentHouliston Sep 22, 2023
d77fa00
Does this do something?
TrentHouliston Sep 22, 2023
6478e56
Show stats for ccache
TrentHouliston Sep 22, 2023
12239e7
Start splitting the tasks into separate workflows
TrentHouliston Sep 22, 2023
33e9a1b
This better?
TrentHouliston Sep 22, 2023
1b1b69c
This looks nicer
TrentHouliston Sep 22, 2023
789d833
Different method of installing
TrentHouliston Sep 22, 2023
be6fe3b
Does this work?
TrentHouliston Sep 22, 2023
10f46a5
Fix versions
TrentHouliston Sep 22, 2023
cb8c9f9
/shrug
TrentHouliston Sep 22, 2023
88cf2b8
Use the new compiler
TrentHouliston Sep 22, 2023
59d2e37
:(
TrentHouliston Sep 22, 2023
3efb151
:( :(
TrentHouliston Sep 22, 2023
2b7ca1c
Full path?
TrentHouliston Sep 22, 2023
8871a28
.
TrentHouliston Sep 22, 2023
0dde1c4
ninja
TrentHouliston Sep 22, 2023
6017330
.
TrentHouliston Sep 22, 2023
e465b6c
let ninja be ninja
TrentHouliston Sep 22, 2023
b0bde5d
Fix clang-tidy arg
TrentHouliston Sep 22, 2023
5b88f0a
Move osx into its own workflow
TrentHouliston Sep 22, 2023
5461f35
Use ninja
TrentHouliston Sep 22, 2023
c4ed562
Move windows into it's own workflow
TrentHouliston Sep 22, 2023
c60c426
Install ninja and cmake
TrentHouliston Sep 22, 2023
827c6e0
Install cmake/ninja
TrentHouliston Sep 22, 2023
263334f
Try setup windows to work
TrentHouliston Sep 22, 2023
e887512
.
TrentHouliston Sep 22, 2023
6926fe7
Fix windows
TrentHouliston Sep 22, 2023
afd16a1
Build on windows with both msvc and gcc
TrentHouliston Sep 22, 2023
2b7b38a
Add things to path
TrentHouliston Sep 22, 2023
3a67f2c
Continue even when other matrix jobs fail
TrentHouliston Sep 22, 2023
c1e316a
Tests different
TrentHouliston Sep 22, 2023
ecc5136
This is already done
TrentHouliston Sep 22, 2023
8319baa
Fix segfault
TrentHouliston Sep 22, 2023
47a96fb
Turn on clang-tidy here
TrentHouliston Sep 22, 2023
f1417cb
Remove redundant comments
TrentHouliston Sep 22, 2023
718377a
Windows was never running clang-tidy after all
TrentHouliston Sep 24, 2023
9d17953
Fix some issues
TrentHouliston Sep 24, 2023
10def50
No clang-tidy on windows for now (not the point of this PR)
TrentHouliston Sep 24, 2023
2320116
100M of cache is more than enough
TrentHouliston Sep 24, 2023
9521d2d
Cache sonar
TrentHouliston Sep 24, 2023
2000e4e
Fix linting
TrentHouliston Sep 24, 2023
3f10bcf
Make the job name not just be a number
TrentHouliston Sep 24, 2023
79d7d6d
make cache make more sense
TrentHouliston Sep 24, 2023
447c0a3
Make names make sense
TrentHouliston Sep 24, 2023
a53063b
make names make sense
TrentHouliston Sep 24, 2023
3cd62b1
Make name match
TrentHouliston Sep 24, 2023
ae8092a
normalise more things
TrentHouliston Sep 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/gcc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Continuous Integration tests
name: GCC

on:
push:
branches: [main]
pull_request:
branches: [main]

# Ensure that only one instance of the workflow is run at a time for each branch/tag.
# Jobs currently running on the branch/tag will be cancelled when new commits are pushed.
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency.
concurrency:
# `github.workflow` is the workflow name, `github.ref` is the current branch/tag identifier
group: ${{ format('{0}:{1}', github.workflow, github.ref) }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
linux-gcc:
strategy:
matrix:
toolchain:
- container: ubuntu:22.04
version: "13"
- container: ubuntu:22.04
version: "12"
- container: ubuntu:22.04
version: "11"
- container: ubuntu:22.04
version: "10"
- container: ubuntu:22.04
version: "9"
- container: ubuntu:20.04
version: "8"
- container: ubuntu:20.04
version: "7"
- container: ubuntu:18.04
version: "6"
- container: ubuntu:18.04
version: "5"

name: Linux GCC-${{ matrix.toolchain.version }}
runs-on: ubuntu-latest
continue-on-error: true

# Use the container for this specific version of gcc
container: ${{ matrix.toolchain.container }}

steps:
- name: Checkout Code
uses: actions/checkout@v3

# Update for all the actions that need to install stuff
- run: |
apt-get update
apt-get install -y software-properties-common

- name: Install GCC
run: |
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install -y gcc-${{ matrix.toolchain.version }} g++-${{ matrix.toolchain.version }}

- name: Install CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.27.1
ninjaVersion: 1.11.1

- name: Setup CCache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}-gcc-${{ matrix.toolchain.version }}
max-size: 100M

- name: Configure CMake
run: |
cmake -E make_directory build
cmake -S . -B build \
-GNinja \
-DCMAKE_C_COMPILER=/usr/bin/gcc-${{ matrix.toolchain.version }} \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-${{ matrix.toolchain.version }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCI_BUILD=ON \
-DENABLE_CLANG_TIDY=OFF

- name: Build
timeout-minutes: 30
run: cmake --build build --config Release

- name: CCache Stats
run: ccache --show-stats

- name: Test
timeout-minutes: 10
run: |
build/tests/test_nuclear
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
69 changes: 69 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Linting

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]

# Ensure that only one instance of the workflow is run at a time for each branch/tag.
# Jobs currently running on the branch/tag will be cancelled when new commits are pushed.
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency.
concurrency:
# `github.workflow` is the workflow name, `github.ref` is the current branch/tag identifier
group: ${{ format('{0}:{1}', github.workflow, github.ref) }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
linux-clang-tidy:
name: Linux Clang-Tidy
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Install clang-tidy-15
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | sudo tee /etc/apt/sources.list.d/llvm-15
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | sudo tee -a /etc/apt/sources.list.d/llvm-15
sudo apt-get update
sudo apt-get install -y clang-tidy-15

# Download and install cmake
- name: Install CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.27.1
ninjaVersion: 1.11.1

# Download and setup ccache
- name: Setup CCache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
max-size: 100M

- name: Configure CMake
run: |
cmake -E make_directory build
cmake -S . -B build \
-GNinja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCI_BUILD=ON \
-DENABLE_CLANG_TIDY=ON

- name: Build
timeout-minutes: 30
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build build --config Release --parallel 2

- name: CCache Stats
run: ccache --show-stats
63 changes: 63 additions & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Continuous Integration tests
name: MacOS

on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]

# Ensure that only one instance of the workflow is run at a time for each branch/tag.
# Jobs currently running on the branch/tag will be cancelled when new commits are pushed.
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency.
concurrency:
# `github.workflow` is the workflow name, `github.ref` is the current branch/tag identifier
group: ${{ format('{0}:{1}', github.workflow, github.ref) }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
macos-latest:
name: MacOS Latest
runs-on: macos-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup CCache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
max-size: 100M

- name: Install CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.27.1
ninjaVersion: 1.11.1

- name: Configure CMake
run: |
cmake -E make_directory build
cmake -S . -B build \
-GNinja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCI_BUILD=ON \
-DENABLE_CLANG_TIDY=OFF

- name: Build
timeout-minutes: 30
run: cmake --build build --config Release

- name: CCache Stats
run: ccache --show-stats

- name: Test
timeout-minutes: 10
run: |
build/tests/test_nuclear
for f in build/tests/individual/*; do echo "Testing $f"; ./$f; done
Loading