-
-
Notifications
You must be signed in to change notification settings - Fork 359
166 lines (135 loc) · 4.44 KB
/
ccpp.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: C/C++ CI
on: [push, pull_request]
jobs:
build:
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
name: "Builds binaries on ${{ matrix.os }}"
steps:
- uses: actions/checkout@v1
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.5.3'
- name: Update git submodule
run: |
git submodule update --init
- name: Restore xmake packages
uses: actions/cache@v3
with:
path: ~/.xmake/.cache/packages
key: ${{ runner.os }}-xmake-packages
- name: Install tools
if: runner.os == 'Linux'
run: sudo apt install debhelper lcov valgrind -yy
- name: Configure for coverage mode
if: runner.os == 'Linux'
run: xmake config -m coverage -y -v --ci-env=y
- name: Configure
if: runner.os == 'Windows'
run: xmake config -y -v -k shared --ci-env=y
- name: Build
run: xmake -w
- name: Run YUtil tests
if: runner.os == 'Windows'
run: |
xmake build yutil_test
xmake run yutil_test
- name: Run PandaGL tests
run: xmake run pandagl_tests
- name: Run LibCSS tests
if: runner.os == 'Windows'
run: xmake run libcss_tests
- name: Run LibUIRouter tests
if: runner.os == 'Windows'
run: xmake run libui-router-tests
- name: Run LibI18n tests
if: runner.os == 'Windows'
run: xmake run libi18n-tests
- name: Run LCUI tests
if: runner.os == 'Windows'
run: xmake run lcui_tests
- name: Run YUtil tests with memcheck
if: runner.os == 'Linux'
run: |
xmake build yutil_test
xmake run yutil_test --memcheck
- name: Run LibCSS tests with memcheck
if: runner.os == 'Linux'
run: xmake run libcss_tests --memcheck
- name: Run LibUIRouter tests with memcheck
if: runner.os == 'Linux'
run: xmake run libui-router-tests --memcheck
- name: Run LibI18n tests with memcheck
if: runner.os == 'Linux'
run: xmake run libi18n-tests --memcheck
- name: Run LCUI tests with memcheck
if: runner.os == 'Linux'
run: xmake run lcui_tests --memcheck
- name: Upload reports to Codecov
if: runner.os == 'Linux'
run: bash <(curl -s https://codecov.io/bash);
- name: Reconfigure for release
if: runner.os == 'Linux'
run: xmake config -y -v -k shared --ci-env=y
- name: Package
run: |
xmake package
xmake install -o dist/lcui-package
- name: Package examples
run: |
cd examples
xmake -P . -v -y
xmake install -P . -o ../dist/lcui-examples
mv ../dist/lcui-examples/bin/* ../dist/lcui-examples/
rm -r ../dist/lcui-examples/bin
- uses: actions/upload-artifact@master
with:
name: lcui-package (${{ runner.os }})
path: |
dist/lcui-package
- uses: actions/upload-artifact@master
with:
name: lcui-examples (${{ runner.os }})
path: |
dist/lcui-examples
- name: Cache xmake packages
uses: actions/cache@v3
with:
path: ~/.xmake/.cache/packages
key: ${{ runner.os }}-xmake-packages
release:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [build]
env:
ARTIFACT_DIR: ./release
steps:
- uses: actions/checkout@v1
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ${{ env.ARTIFACT_DIR }}
- name: Set release version
run: python ./.github/scripts/get_release_version.py
- name: Create release notes
run: python ./.github/scripts/get_release_notes.py
- name: Read package.json
id: release_notes
uses: juliangruber/read-file-action@v1
with:
path: RELEASE_NOTES.md
trim: false
- name: Create release
uses: svenstaro/upload-release-action@v2
with:
body: ${{ steps.release_notes.outputs.content }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: LCUI ${{ env.REL_VERSION }}
tag: ${{ github.ref }}
file: ${{ env.ARTIFACT_DIR }}/*
overwrite: true
file_glob: true