-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (50 loc) · 1.57 KB
/
cpp-11-standard.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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:
token: ${{ secrets.STANDARDS_TOKEN }}
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- 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-beta
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Test coverage percentage
run: python request.py
env:
API_KEY: ${{ secrets.API_KEY }}
EXPECTED_COVERAGE: ${{ secrets.EXPECTED_COVERAGE }}
- name: Upstream to Standards
env:
GH_TOKEN: ${{ secrets.STANDARDS_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