-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (67 loc) · 2.48 KB
/
test.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Unit test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
system: [client, server]
exclude:
- os: macos-latest
system: server
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
SYSTEM: ${{ matrix.system }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install tools
run: |
if [ "${OS}" == "macOS-latest" ]; then
brew install bats-core kcov parallel
elif [ "${OS}" == "ubuntu-latest" ]; then
sudo apt-get install -y bats kcov parallel
else
echo "${OS} and ${SYSTEM} are not supported" >&2
exit 1
fi
- name: Run unit test
run: |
./scripts/run_test.sh
- name: Set flag for codecov
run: |
if [ "${OS}" == "macOS-latest" ]; then
echo "flags=${OS}" >> $GITHUB_ENV
elif [ "${OS}" == "ubuntu-latest" ]; then
echo "flags=${OS}-${SYSTEM}" >> $GITHUB_ENV
else
echo "${OS} and ${SYSTEM} are not supported" >&2
exit 1
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
# directory: ./coverage/kcov-merged
files: ./coverage/kcov-merged/cobertura.xml
env_vars: OS,SYSTEM
fail_ci_if_error: true
flags: ${{ env.flags }}
name: codecov-dotfiles
verbose: true
# run: |
# bash <(curl -s https://codecov.io/bash) \
# -n "codecov-dotfiles" `# Custom defined name of the upload. Visible in Codecov UI.` \
# -s ./coverage/kcov-merged `# Directory to search for coverage reports.` \
# -t ${{ secrets.CODECOV_TOKEN }} `# Set the private repository token.` \
# -e OS,SYSTEM `# Specify environment variables to be included with this build.` \
# -C ${{ github.sha }} `# Specify the commit sha.` \
# -F ${{ env.flags }} `# Flag the upload to group coverage metrics.` \
# -Z `# Exit with 1 if not successful. Default will Exit with 0.` \
# -v `# Verbose mode.`