diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 0000000..ed66f0a --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,21 @@ +name: C/C++ CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: add curl + run: sudo apt-get install libcurl4-openssl-dev + - name: configure + run: ./configure + - name: cmake with fetching + run: cmake -DUSE_EXTERNAL_DPP=OFF -DUSE_EXTERNAL_JSON=OFF + - name: make + run: make diff --git a/README.md b/README.md index 68fa9ee..1e197be 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ This is a Discord bot that can be used to query crypto prices using the Coingeck cd crypto-prices-slash-bot-cpp mkdir build && cd build - cmake .. + cmake .. -B./ make ``` @@ -46,10 +46,13 @@ This is a Discord bot that can be used to query crypto prices using the Coingeck cd crypto-prices-slash-bot-cpp mkdir build && cd build - cmake -DUSE_EXTERNAL_DPP=OFF -DUSE_EXTERNAL_JSON=OFF .. + cmake -DUSE_EXTERNAL_DPP=OFF -DUSE_EXTERNAL_JSON=OFF .. -B./ make ``` +### Additional +- In case you're got error while trying `make` that caused by `curl` try install it first. ex: `sudo apt-get install libcurl4-openssl-dev` + ### Running the binary - Mandatory environment variable for Discord token: `DISCORD_TOKEN` - Run: diff --git a/configure b/configure new file mode 100755 index 0000000..6f3d8ba --- /dev/null +++ b/configure @@ -0,0 +1,4 @@ +CXX=g++ # The C++ compiler +CXXFLAGS=-g # C++ complilation flags +NATIVE=on # compiles code targeted to current hardware +TUNE=generic # performance-tuning switch