Skip to content

Update actions/checkout digest to 0ad4b8f #891

Update actions/checkout digest to 0ad4b8f

Update actions/checkout digest to 0ad4b8f #891

Workflow file for this run

name: Build C2EO
on:
pull_request:
branches:
- master
jobs:
xcop:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: g4s8/xcop-action@master
pdd:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
# - uses: g4s8/pdd-action@master
cpplint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Install cpplint
run: sudo pip install cpplint
- name: Cpplint
run: cpplint --filter=-runtime/references,-runtime/string,-build/c++11 project/src/transpiler/**
clang-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Clang-format
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: '14'
check-path: 'project/src/transpiler'
fallback-style: 'Google'
clang-tidy:
needs: [cpplint, clang-format]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: MarkusJx/googletest-installer@v1.1
- name: Cache LLVM
uses: actions/cache@v3
with:
path: llvm-clang.tar.gz
key: ${{ runner.os }}-llvm-clang
- name: Unpack LLVM
run: sudo chmod ugo+rwx llvm-clang.tar.gz && tar -xvf llvm-clang.tar.gz -C . > /dev/null
- name: Install clang-tidy
run: sudo apt install clang-tidy
- name: Clang-tidy
run: |
cd ./project/scripts
python3 clang_tidy.py -h
python3 clang_tidy.py
gcc-c-torture:
needs: [cpplint, clang-format]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: MarkusJx/googletest-installer@v1.1
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: llvm-clang.tar.gz
key: ${{ runner.os }}-llvm-clang
- name: Unpack LLVM
run: sudo chmod ugo+rwx llvm-clang.tar.gz && tar -xvf llvm-clang.tar.gz -C . > /dev/null
- name: Download gcc-c-torture
uses: robinraju/release-downloader@v1.10
with:
repository: "polystat/c2eo"
tag: "0.1.16"
fileName: "gcc.c-torture.tar.gz"
- name: Unpack gcc-c-torture
run: tar -xvf gcc.c-torture.tar.gz -C . > /dev/null
- name: Transpilation
run: |
cd ./project/scripts
python3 transpile.py -h
python3 transpile.py ../../gcc.c-torture -s gcc -n
c-testcuite:
needs: [cpplint, clang-format]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: MarkusJx/googletest-installer@v1.1
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: llvm-clang.tar.gz
key: ${{ runner.os }}-llvm-clang
- name: Unpack LLVM
run: sudo chmod ugo+rwx llvm-clang.tar.gz && tar -xvf llvm-clang.tar.gz -C . > /dev/null
- name: Download c-testcuite
uses: robinraju/release-downloader@v1.10
with:
repository: "polystat/c2eo"
tag: "0.1.16"
fileName: "c-testcuite.tar.gz"
- name: Unpack c-testcuite
run: tar -xvf c-testcuite.tar.gz -C . > /dev/null
- name: Testing
run: |
cd ./project/scripts
python3 test.py -h
python3 test.py -p ../../c-testcuite -s testcuite -n -c
- name: Convert raw code coverage to report
run: |
cd ./project/bin/
llvm-profdata-14 merge -sparse *.profraw -o res.profdata
llvm-cov-14 show ./c2eo ../src/transpiler/*.cpp -instr-profile=res.profdata > codecov.txt
- uses: actions/upload-artifact@v3
with:
name: testcuite
path: project/bin/codecov.txt
test_main:
needs: [cpplint, clang-format]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: MarkusJx/googletest-installer@v1.1
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: llvm-clang.tar.gz
key: ${{ runner.os }}-llvm-clang
- name: Unpack LLVM
run: sudo chmod ugo+rwx llvm-clang.tar.gz && tar -xvf llvm-clang.tar.gz -C . > /dev/null
- name: Testing
run: |
cd ./project/scripts
python3 test.py -h
python3 test.py -s test -c
- name: Convert raw code coverage to report
run: |
cd ./project/bin/
llvm-profdata-14 merge -sparse *.profraw -o res.profdata
llvm-cov-14 show ./c2eo ../src/transpiler/*.cpp -instr-profile=res.profdata > codecov.txt
- uses: actions/upload-artifact@v3
with:
name: main
path: project/bin/codecov.txt
unit-tests:
needs: [cpplint, clang-format]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: MarkusJx/googletest-installer@v1.1
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: llvm-clang.tar.gz
key: ${{ runner.os }}-llvm-clang
- name: Unpack LLVM
run: sudo chmod ugo+rwx llvm-clang.tar.gz && tar -xvf llvm-clang.tar.gz -C . > /dev/null
- name: Build c2eo
run: cd ./project/scripts && python3 build_c2eo.py
- name: Unit testing
run: cd ./project/bin/ && ./unit_tests --gtest_filter=*
codecov:
needs: [clang-tidy, gcc-c-torture, c-testcuite, test_main, unit-tests]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- run: mkdir project/bin/
- name: Download test main codecov report
uses: actions/download-artifact@v3
with:
name: main
path: project/bin/main/
- name: Download testcuite codecov report
uses: actions/download-artifact@v3
with:
name: testcuite
path: project/bin/testcuite/
- uses: codecov/codecov-action@v4
with:
files: ./project/bin/main/codecov.txt,./project/bin/testcuite/codecov.txt