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

Adding Initial Support for CI Build #2

Merged
merged 5 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -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