-
-
Notifications
You must be signed in to change notification settings - Fork 110
124 lines (103 loc) · 3.61 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
build-linux:
name: Build and test Linux executable
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, armv7, aarch64, ppc64le]
steps:
- uses: actions/checkout@v2
- name: Prepare
run: chmod u+x .github/workflows/*.sh
- name: Build for matrix.arch == amd64
if: ${{ matrix.arch == 'amd64' }}
run: |
sudo .github/workflows/generic-build.sh ${{ matrix.arch }}
sudo .github/workflows/ci-run-tests.sh ${{ matrix.arch }}
wget https://codecov.io/bash || true
bash bash -s /tmp/kcov-kcov || true
- name: Build for matrix.arch == i386
if: ${{ matrix.arch == 'i386' }}
run: |
chmod u+x ./.github/workflows/setup-i386.sh
sudo .github/workflows/setup-i386.sh
sudo schroot -c mychroot -- ./.github/workflows/generic-build.sh ${{ matrix.arch }}
sudo .github/workflows/ci-run-tests.sh ${{ matrix.arch }}
- name: Build for matrix.arch == armv7, aarch64, ppc64le
if: ${{ matrix.arch == 'armv7' || matrix.arch == 'aarch64' || matrix.arch == 'ppc64le' }}
uses: uraimo/[email protected]
with:
architecture: ${{ matrix.arch }}
distribution: ubuntu18.04
run: |
.github/workflows/generic-build.sh ${{ matrix.arch }}
build-osx:
name: Build and test OSX executable (macOS-latest)
runs-on: macOS-latest
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v2
- name: Prepare
run: |
chmod u+x .github/workflows/osx-build.sh .github/workflows/ci-run-tests.sh
brew install zlib bash cmake pkgconfig [email protected] [email protected] dwarfutils
- name: Build for OSX
run: |
sudo .github/workflows/osx-build.sh
sudo .github/workflows/ci-run-tests.sh
build-osx-big-sur:
name: Build and test OSX executable (Big Sur)
runs-on: macOS-11
env:
CC: clang
CXX: clang++
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '11.7.0'
- uses: actions/checkout@v2
- name: Prepare
run: |
chmod u+x .github/workflows/osx-build.sh .github/workflows/ci-run-tests.sh
brew install zlib bash cmake pkgconfig [email protected] [email protected] dwarfutils
- name: Build for OSX
run: |
sudo .github/workflows/osx-build.sh
sudo .github/workflows/ci-run-tests.sh
build-freebsd:
runs-on: macos-12
name: Build and test FreeBSD executable
steps:
- uses: actions/checkout@v2
- name: FreeBSD
id: test
uses: vmactions/freebsd-vm@v0
with:
usesh: true
sync: rsync
prepare: pkg install -y binutils cmake elfutils python bash git
run: |
chmod u+x .github/workflows/freebsd-build.sh .github/workflows/ci-run-tests.sh
.github/workflows/freebsd-build.sh x86_64
.github/workflows/ci-run-tests.sh
build-and-push-docker-image:
needs: [build-linux, build-osx, build-freebsd]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Docker Hub login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
- name: Build docker image
run: docker build -t kcov/kcov:latest .
- name: Push to Docker Hub
run: docker push kcov/kcov:latest