Skip to content

Update ci.yml

Update ci.yml #10

Workflow file for this run

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
# Convert the project name to lowercase
PROJECT_LOWER=$(echo "${{ matrix.project }}" | tr '[:upper:]' '[:lower:]')
./bin/test_$PROJECT_LOWER
./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 }}