-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (123 loc) · 3.19 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
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
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: yes
HOMEBREW_NO_ENV_HINTS: yes
HOMEBREW_NO_ANALYTICS: yes
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv/
token: ${{ secrets.GH_PAT }}
sparse-checkout: |
include/libgetargv.h
sparse-checkout-cone-mode: false
- run: mv include/libgetargv.h /usr/local/include/libgetargv.h
working-directory: getargv
- name: check
run: "make LIBVER=$(sw_vers -ProductVersion) lint"
test:
name: Test on ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os:
- 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 install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.cpp
- 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
- name: build unit tests
run: make lib_unit_tests
working-directory: getargv.cpp/test
- name: build libtests
run: |
make libtest1
make libtest2
working-directory: getargv.cpp/test
- name: run tests with coverage
if: matrix.os != 'macos-10.15'
run: make run_lib_unit_tests_coverage
timeout-minutes: 5
working-directory: getargv.cpp/test
- name: run tests without coverage
if: matrix.os == 'macos-10.15'
run: make run_lib_unit_tests
timeout-minutes: 5
working-directory: getargv.cpp/test
build:
name: Build on ${{ matrix.os }}
timeout-minutes: 5
needs: [ check, test ]
strategy:
matrix:
os:
- macos-13
- macos-12
- macos-11
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: make exe
run: make CPU_FLAGS="" MACOS_VER_MINOR=0 release
- name: make CPU_FLAGS="" MACOS_VER_MINOR=0 library
run: make dylib
- name: make installer
run: make dmg
- name: rename dmg
run: mv pkg/*.dmg pkg/getargv-${{ matrix.os }}.dmg
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}.zip
path: |
pkg/*.pkg
pkg/*.dmg
release:
if: ${{ github.ref_type == 'tag' }}
needs: [ build ]
timeout-minutes: 5
runs-on: macos-latest
steps:
- uses: actions/download-artifact@v3
with:
path: pkg
- name: Release
uses: softprops/action-gh-release@v1
with:
files: pkg/*.zip/*.dmg
name: ${{ github.ref_name }}