Skip to content

chore(ci): upgrade to action v4 #536

chore(ci): upgrade to action v4

chore(ci): upgrade to action v4 #536

name: Github Actions C++ Standard
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-and-upstream:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Before Install
run: |
pip install requests
sudo apt-get install g++
- name: Run Tests
env:
API_KEY: ${{ secrets.API_KEY }}
EXPECTED_COVERAGE: ${{ secrets.EXPECTED_COVERAGE }}
run: |
g++ -std=c++11 -o TestBinary -fprofile-arcs -ftest-coverage test/test_index.cpp
./TestBinary
gcov -o . test/test_index.cpp
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Test coverage percentage
run: python request.py
- name: Upstream to Standards
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
COVERAGE_SOURCE_FILE: ${{ secrets.COVERAGE_SOURCE_FILE }}
if: ${{ github.event_name == 'push'}}
run: |
wget --header "Authorization: token ${GH_TOKEN}" \
--header "Accept: application/vnd.github.v3.raw" \
https://api.github.com/repos/codecov/standards/contents/upstream.sh
bash upstream.sh