-
-
Notifications
You must be signed in to change notification settings - Fork 108
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 #334 from l3laze/auto-build
Prebuilt releases
- Loading branch information
Showing
5 changed files
with
113 additions
and
0 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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
run () { | ||
apt-get update | ||
apt-mark hold php* google* libobjc* libpq* libidn* postgresql* python-samba python3-httplib2 samba* >/dev/null | ||
apt-get upgrade -y | ||
apt-get install -y binutils-dev libcurl4-openssl-dev libdw-dev libiberty-dev gcc g++ make cmake libssl-dev git python python3 | ||
export PATH="${PATH}:${HOME}/kcov/bin" | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. || exit 64 | ||
make || exit 64 | ||
make install || exit 64 | ||
cd .. | ||
tar czf kcov-"$1".tar.gz /usr/local/bin/kcov* /usr/local/share/doc/kcov/* /usr/local/share/man/man1/kcov.1 | ||
readelf -h /usr/local/bin/kcov | ||
if [[ -e "kcov-$1.tar.gz" ]]; then | ||
echo "Built for $1". | ||
fi | ||
|
||
chmod u+x .github/workflows/test-executable.sh | ||
kcov --include-path=.github/workflows/test-executable.sh coverage .github/workflows/test-executable.sh | ||
|
||
local coverage="$(<coverage/test*.sh*/coverage.json)" | ||
local percent="${coverage##*percent_covered\": \"}" | ||
local total_lines="${coverage##*total_lines\": }" | ||
local covered_lines="${coverage##*covered_lines\": }" | ||
|
||
echo -e "Coverage: ${covered_lines%%,*}/${total_lines%%,*} ${percent%%\"*}%" | ||
} | ||
|
||
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,58 @@ | ||
name: CI | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
name: Build executable | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [i386, amd64, armv7, aarch64, ppc64le] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Prepare | ||
run: chmod u+x .github/workflows/generic-build.sh | ||
|
||
- name: Build for matrix.arch == amd64 | ||
if: ${{ matrix.arch == 'amd64' }} | ||
run: sudo .github/workflows/generic-build.sh ${{ matrix.arch }} | ||
|
||
- 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 }} | ||
- 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 }} | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: kcov-${{ matrix.arch }}.tar.gz | ||
path: kcov-${{ matrix.arch }}.tar.gz | ||
|
||
create_release: | ||
name: Create release | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
|
||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifacts: kcov-*/kcov-*.tar.gz | ||
artifactContentType: application/gzip | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
apt-get update | ||
apt-get install schroot debootstrap | ||
install -d /chroots/i386 | ||
|
||
printf "[mychroot] | ||
type=directory | ||
description=An i386 chroot for building kcov. | ||
directory=/chroots/i386 | ||
users=$(whoami) | ||
root-groups=root | ||
preserve-environment=true | ||
personality=linux32" >> /etc/schroot/schroot.conf | ||
|
||
debootstrap --variant=buildd --arch i386 bionic /chroots/i386 http://archive.ubuntu.com/ubuntu/ |
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,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ true ]]; then | ||
echo "Hello, kcov!" | ||
fi |
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 @@ | ||
README.md |