From b1f543585f9e782afd8a98a4e6c2220b8049c936 Mon Sep 17 00:00:00 2001 From: Shamy <110725453+shamykyzer@users.noreply.github.com> Date: Wed, 2 Jul 2025 12:08:01 +0300 Subject: [PATCH] Fix YAML quoting --- .github/workflows/c-cpp.yml | 79 +++++++++++++++++++++++++++++++------ .gitignore | 2 + README.md | 9 +++++ 3 files changed, 78 insertions(+), 12 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 69a4793..75f3d5e 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -1,23 +1,78 @@ +--- name: C/C++ CI -on: +"on": push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: + install-dependencies: + name: Installing Dependencies + runs-on: ubuntu-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: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential libgl1-mesa-dev libglew-dev libglfw3-dev libopenmpi-dev + build: + name: Build + runs-on: ubuntu-latest + needs: install-dependencies + steps: + - uses: actions/checkout@v4 + - name: Restore build cache + uses: actions/cache@v3 + with: + path: | + src/*.o + tests/*.o + key: "${{ runner.os }}-build-${{ hashFiles('**/*.c') }}" + restore-keys: "${{ runner.os }}-build-" + - name: Build + run: make clean && make + test: + name: Test runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v4 + - name: Restore build cache + uses: actions/cache@v3 + with: + path: | + src/*.o + tests/*.o + key: "${{ runner.os }}-build-${{ hashFiles('**/*.c') }}" + restore-keys: "${{ runner.os }}-build-" + - name: Test + run: make test + make: + name: Make + runs-on: ubuntu-latest + needs: test steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential libgl1-mesa-dev libglew-dev libglfw3-dev libopenmpi-dev - - name: Build - run: make - - name: Test - run: make test + - uses: actions/checkout@v4 + - name: Restore build cache + uses: actions/cache@v3 + with: + path: | + src/*.o + tests/*.o + key: "${{ runner.os }}-build-${{ hashFiles('**/*.c') }}" + restore-keys: "${{ runner.os }}-build-" + - name: Make + run: make clean && make diff --git a/.gitignore b/.gitignore index 392d5f9..1cf7a02 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ obj/ # Object files *.o src/*.o +gravity-simulation/ +tests/test_quadtree diff --git a/README.md b/README.md index e52a7bc..752289e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This project is a continuation of fluid simulation concepts, extended to simulat - [Installation](#installation) - [Build](#build) - [Usage](#usage) +- [Continuous Integration](#continuous-integration) - [Project Layout](#project-layout) - [Acknowledgments](#acknowledgments) - [License](#license) @@ -74,6 +75,14 @@ To set up and compile the project on your local machine, follow these steps: ./gravity_simulation ``` +## Continuous Integration + +This project uses a GitHub Actions workflow with four sequential jobs: +**Installing Dependencies**, **Build**, **Test**, and **Make**. Each job +installs the required packages with `apt-get`, and compiled object files are +cached between jobs to speed up subsequent runs. The build steps run +`make clean` before `make` to ensure a fresh compilation each time. + ## Usage To run the simulation: