-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (57 loc) · 2.36 KB
/
cunit.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
51
52
53
54
55
56
57
58
59
60
61
name: Unit Test
on:
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Configure Software
run: |
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install -y gcc g++ automake autoconf libtool wget cmake
wget https://udomain.dl.sourceforge.net/project/cunit/CUnit/2.1-3/CUnit-2.1-3.tar.bz2
- name: Install CUnit
run: |
tar -jxvf CUnit-2.1-3.tar.bz2 && ls && cd CUnit-2.1-3
./bootstrap && ./configure --prefix /home/runner/work/MM32_CLion/MM32_CLion/cunit
make && make install && cd /home/runner/work/MM32_CLion/MM32_CLion/cunit && sudo ldconfig
- name: Run Test Program
run: |
sudo timedatectl set-timezone Asia/Shanghai
ls && cd testbench && mkdir build && ls && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_PLATFORM=github ../
cmake --build ./ --target testbench
export LD_LIBRARY_PATH=/home/runner/work/MM32_CLion/MM32_CLion/cunit/lib
ls && ./testbench && ls
- name: Upload File
uses: actions/upload-artifact@v2
with:
name: UnitTest-Report
path: |
./testbench/build/Report-Listing.xml
./testbench/build/Report-Results.xml
deploy:
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: UnitTest-Report
path: ./
- name: Initialize Git
env:
REPO_PUSH_PRIVATE_KEY_ENV: ${{ secrets.REPO_PUSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh && echo "$REPO_PUSH_PRIVATE_KEY_ENV" > ~/.ssh/id_rsa && sudo chmod 600 ~/.ssh/id_rsa
export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no"
ls && cd docs && ls
- name: Upload Report
run: |
ls && mv ./Report-Listing.xml ./docs/unit_test/Report-Listing.xml && mv ./Report-Results.xml ./docs/unit_test/Report-Results.xml && ls
git config --global user.email "[email protected]" && git config --global user.name "LaoZhu"
git add . && git commit -m "Update the latest unit test reports to Github Pages." && git pull origin master --rebase && git push origin master