From 687c80956e01e25c2bcdd07e70fe71ec30c10d1d Mon Sep 17 00:00:00 2001 From: isuckatcs <65320245+isuckatcs@users.noreply.github.com> Date: Fri, 28 Jun 2024 16:36:08 +0200 Subject: [PATCH] [CI/CD] added pipeline --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ README.MD | 1 + 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 README.MD diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8c31809 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: How To Compile Your Language Pipeline + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +env: + BUILD_TYPE: Debug + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-g -O0 --coverage -fprofile-arcs -ftest-coverage" -DCMAKE_C_FLAGS="-g -O0 --coverage -fprofile-arcs -ftest-coverage" + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: | + pip install lit filecheck + cmake --build . -t test + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..32b0558 --- /dev/null +++ b/README.MD @@ -0,0 +1 @@ +[![codecov](https://codecov.io/github/isuckatcs/how-to-compile-your-language/branch/main/graph/badge.svg?token=SLOD84JALB)](https://codecov.io/github/isuckatcs/how-to-compile-your-language)