diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e9aa450 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,13 @@ +name: CPP CI + +on: + push: + branches: [ "main" ] + +jobs: + name: Buildcpp + runs-on: ubuntu-latest + steps: + - name: Running g++ + run: | + g++ -Wall *.cpp diff --git a/GameDie.cpp b/GameDie.cpp index d512405..e9fb279 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -7,10 +7,10 @@ GameDie::GameDie() { srand(time(NULL)); - counter.resize(FACES); + roll_counter.resize(FACES); for(int i=0; i GameDie::get_distribution(){ - return counter; + return roll_counter; } diff --git a/GameDie.h b/GameDie.h index 54d69ba..939e8f7 100644 --- a/GameDie.h +++ b/GameDie.h @@ -13,7 +13,7 @@ class GameDie vector get_distribution(); private: - vector counter; + vector roll_counter; const static int FACES = 6; }; diff --git a/README.md b/README.md index 9a8fe2c..03b672a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![.github/workflows/main.yml](https://github.com/AverageOtter/GameDie/actions/workflows/main.yml/badge.svg)](https://github.com/AverageOtter/GameDie/actions/workflows/main.yml) # GameDie This repository provides a class that represents a game die, such as the @@ -23,4 +24,4 @@ Once built, run the image: ...or run it with a bind mount to the current source code: -`docker run --mount type=bind,source="$(pwd)",target=/usr/src -it cpp-container` \ No newline at end of file +`docker run --mount type=bind,source="$(pwd)",target=/usr/src -it cpp-container`