-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from SimonKagstrom/issue-345-github-actions
Issue #345: Use github actions as CI
- Loading branch information
Showing
22 changed files
with
308 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: [SimonKagstrom] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
run () { | ||
tests/tools/run-tests build/src/kcov /tmp/ build-tests/ `pwd` -v || exit 64 | ||
} | ||
|
||
run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
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/run-on-arch-action@v1.0.9 | ||
with: | ||
architecture: ${{ matrix.arch }} | ||
distribution: ubuntu18.04 | ||
run: | | ||
.github/workflows/generic-build.sh ${{ matrix.arch }} | ||
build-osx: | ||
name: Build and test OSX executable | ||
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 python@3.9 openssl@1.1 | ||
- name: Build for OSX | ||
run: | | ||
sudo .github/workflows/osx-build.sh | ||
sudo .github/workflows/ci-run-tests.sh | ||
build-freebsd: | ||
runs-on: macos-latest | ||
name: Build and test FreeBSD executable | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: FreeBSD | ||
id: test | ||
uses: vmactions/freebsd-vm@v0.0.9 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
run () { | ||
export PATH="${PATH}:${HOME}/kcov/bin" | ||
mkdir build build-tests | ||
cd build | ||
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. || exit 64 | ||
make || exit 64 | ||
make install || exit 64 | ||
cd .. | ||
cd build-tests | ||
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../tests || exit 64 | ||
make || exit 64 | ||
cd .. | ||
} | ||
|
||
run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
run () { | ||
export PATH="${PATH}:${HOME}/kcov/bin" | ||
mkdir build build-tests | ||
cd build | ||
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_INSTALL_PREFIX=/usr/local .. || exit 64 | ||
make || exit 64 | ||
make install || exit 64 | ||
cd .. | ||
cd build-tests | ||
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../tests || exit 64 | ||
make || exit 64 | ||
cd .. | ||
} | ||
|
||
run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
run () { | ||
export PATH="${PATH}:${HOME}/kcov/bin" | ||
git submodule update --recursive --remote | ||
|
||
mkdir build-ut | ||
cd build-ut | ||
cmake ../tests/unit-tests || exit 64 | ||
make || exit 64 | ||
./ut || exit 64 | ||
cd .. | ||
} | ||
|
||
run "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,6 @@ int main() { | |
ofs << ++i << std::endl; | ||
sleep(1); | ||
} | ||
printf("Over and out\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
if [ $# -ne 3 ] ; then | ||
echo "Usage: <kcov-binary> <out-dir> <program-to-run>" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.