CICD Implementation #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test TCP File System | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake g++ make | |
- name: Configure with CMake | |
run: | | |
mkdir -p build | |
cd build | |
cmake .. | |
- name: Build with CMake | |
run: | | |
cd build | |
cmake --build . | |
- name: Run tests | |
run: | | |
cd build | |
ctest --output-on-failure | |
- name: Start server | |
run: | | |
cd build | |
nohup ./server & | |
- name: Run client | |
run: | | |
cd build | |
./client |