-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (45 loc) · 1.5 KB
/
Copy pathtest.yml
File metadata and controls
50 lines (45 loc) · 1.5 KB
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
name: commit_test
on:
push: #设置触发规则
branches:
- main
- master
jobs:
build:
strategy:
matrix: # 会分开成两个任务分别执行
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false # 一个系统失败不终止其他系统的任务
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code #这部分是为了从github自动clone代码
uses: actions/checkout@v4
with:
submodules: true
- name: Run in windows
if: matrix.os == 'windows-latest'
run: |
cd src
mkdir build
cd build
cmake -G "MinGW Makefiles" .. -DENABLE_SSL=OFF
make
cd ..
./bin/test_bin.exe
# Invoke-WebRequest -Uri "https://raw.githubusercontent.com/chenxuan520/gh-action-shell/main/cmd_retry.ps1" -OutFile ".\cmd_retry.ps1" -UseBasicParsing
# ./cmd_retry.ps1 ./bin/test_bin.exe 2
- name: Run test #需要执行的命令
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
cd src
./build.sh
wget https://raw.githubusercontent.com/chenxuan520/gh-action-shell/main/cmd_retry.sh
chmod +x ./cmd_retry.sh
./cmd_retry.sh ./bin/test_bin 2
- name: Run Memory Check
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt -y install valgrind
cd src
valgrind --leak-check=full ./bin/test_bin