-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (161 loc) · 4.34 KB
/
actions.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++/make CI
on:
push:
branches: [ main ]
tags: [ '*' ]
pull_request:
branches: [ main ]
jobs:
check:
name: Check code
runs-on: macos-latest
timeout-minutes: 5
steps:
- name: install deps
run: |
brew update
brew install --force-bottle bear llvm
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: yes
HOMEBREW_NO_ENV_HINTS: yes
HOMEBREW_NO_ANALYTICS: yes
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make dylib
working-directory: getargv
- name: Install libgetargv
run: sudo make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.cpp
- name: check
run: "make LIBVER=$(sw_vers -ProductVersion) lint"
working-directory: getargv.cpp
test:
name: Test on ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os:
- macos-14
- macos-13
- macos-12
#- macos-11
runs-on: ${{ matrix.os }}
steps:
- name: install deps
run: |
brew update
brew install --force-bottle criterion
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: yes
HOMEBREW_NO_ENV_HINTS: yes
HOMEBREW_NO_ANALYTICS: yes
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make dylib
working-directory: getargv
- name: Install libgetargv
run: sudo make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.cpp
- name: build unit tests
run: make lib_unit_tests
working-directory: getargv.cpp/test
- run: "echo | clang++ -c -v -x c++ -"
- name: build libtests
run: make libtest1 libtest2
working-directory: getargv.cpp/test
- name: run tests with coverage
run: make run_lib_unit_tests_coverage
timeout-minutes: 5
working-directory: getargv.cpp/test
build:
name: Build on ${{ matrix.os }}
timeout-minutes: 5
needs: [ check, test ]
strategy:
matrix:
os:
- macos-14
- macos-13
- macos-12
#- macos-11
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make dylib
working-directory: getargv
- name: Install libgetargv
run: sudo make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.cpp
- name: bump version
run: make bump
working-directory: getargv.cpp
- name: make library
run: make dylib
working-directory: getargv.cpp
- name: make installer
run: make dmg
working-directory: getargv.cpp
- name: rename dmg
run: mv pkg/*.dmg pkg/libgetargv++-${{ matrix.os }}.dmg
working-directory: getargv.cpp
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}.zip
path: |
getargv.cpp/pkg/*.pkg
getargv.cpp/pkg/*.dmg
release:
needs: [ build ]
permissions:
contents: write
runs-on: ubuntu-latest
env:
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
MACOS_VER_NUM: 14
CERT_IDENTITY: me
steps:
- uses: actions/checkout@v4
with:
path: getargv.cpp
- uses: actions/download-artifact@v3
with:
path: pkg
- name: bump version
id: version
run: echo "version=$(make bump)" >> $GITHUB_OUTPUT
working-directory: getargv.cpp
# do not merge these steps, version is scraped by makefile
# at start of run, so needs to be bumped separately
- name: tag & commit
run: make tag
working-directory: getargv.cpp
- name: Release
uses: softprops/action-gh-release@v1
with:
files: pkg/*.zip/*.dmg
name: ${{ steps.version.ouputs.version }}