Skip to content
Merged
Changes from all commits
Commits
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
30 changes: 14 additions & 16 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ jobs:
container: ghcr.io/gravity-sim/deps:latest
steps:
- uses: actions/checkout@v4
- name: Cache build artifacts
uses: actions/cache@v3
with:
path: |
src/*.o
tests/*.o
key: ${{ runner.os }}-build-${{ hashFiles('**/*.c') }}
restore-keys: ${{ runner.os }}-build-
- name: Setup complete
run: echo "Dependencies are pre-installed in the container"

Expand All @@ -32,15 +24,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Restore build cache
uses: actions/cache@v3
id: build-cache
uses: actions/cache/restore@v3
with:
path: |
src/*.o
tests/*.o
key: ${{ runner.os }}-build-${{ hashFiles('**/*.c') }}
restore-keys: ${{ runner.os }}-build-
- name: Build
run: make
- name: Save build cache
if: steps.build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
src/*.o
tests/*.o
key: ${{ steps.build-cache.outputs.cache-primary-key }}

test:
name: Test
Expand All @@ -50,13 +50,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Restore build cache
uses: actions/cache@v3
uses: actions/cache/restore@v3
with:
path: |
src/*.o
tests/*.o
key: ${{ runner.os }}-build-${{ hashFiles('**/*.c') }}
restore-keys: ${{ runner.os }}-build-
- name: Test
run: make test

Expand All @@ -70,19 +69,18 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev libglew-dev libglfw3-dev libopenmpi-dev
sudo apt-get install -y build-essential libgl1-mesa-dev libglew-dev libglfw3-dev
- name: Build
run: make
- name: Test
run: make test
- uses: actions/checkout@v4
- name: Restore build cache
uses: actions/cache@v3
uses: actions/cache/restore@v3
with:
path: |
src/*.o
tests/*.o
key: ${{ runner.os }}-build-${{ hashFiles('**/*.c') }}
restore-keys: ${{ runner.os }}-build-
- name: Make
run: make
run: make