fix ci.yml #12
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# Job 1: Build and test projects under 'data-structures' | |
data-structures-build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Add your projects from 'data-structures' | |
project: [LinkedList, DoublyLinkedList] | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Step 2: Install dependencies (C++ tools) | |
- name: Install dependencies | |
run: sudo apt-get install -y gcc g++ make cmake lcov | |
# Step 3: Build and test each project in 'data-structures' | |
- name: Build and test project | |
run: | | |
# Navigate to the correct project directory | |
cd data-structures/${{ matrix.project }} | |
# Run the build script for the project | |
./build.sh | |
./bin/test_${{ matrix.project }} | |
./clean.sh | |
# Step 4: Upload coverage to Codecov | |
- name: Upload coverage to Codecov | |
run: bash <(curl -s https://codecov.io/bash) | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |