This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from tarosky/dev/harai
Build using GitHub Actions
- Loading branch information
Showing
5 changed files
with
112 additions
and
1 deletion.
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,57 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
- issue/* | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# Pre-installed packages break the environment required to build BCC. | ||
# That's why I decided to use Docker inside GitHub Actions. | ||
- run: docker image build -f=build/Dockerfile -t box:latest . | ||
- run: docker container run --rm --mount type=bind,source="$(pwd)",target=/workspace box:latest go build -o work/nudge . | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: artifact | ||
path: work/nudge | ||
|
||
release: | ||
needs: build | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
- name: Generate build number | ||
uses: einaregilsson/build-number@v2 | ||
with: | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
prefix: build_number_generator | ||
- name: Print new build number | ||
run: echo "Build number is $BUILD_NUMBER" | ||
- id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
tag_name: build-${{env.BUILD_NUMBER}} | ||
release_name: Build ${{env.BUILD_NUMBER}} | ||
draft: false | ||
prerelease: false | ||
- uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
upload_url: ${{steps.create_release.outputs.upload_url}} | ||
asset_path: ./nudge | ||
asset_name: nudge.build-${{env.BUILD_NUMBER}}-linux-amd64 | ||
asset_content_type: application/octet-stream |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ARG BCC_VERSION=0.16.0 | ||
ARG GO_VERSION=1.15.2 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
arping \ | ||
bison \ | ||
build-essential \ | ||
cmake \ | ||
flex \ | ||
git \ | ||
iperf3 \ | ||
libclang-9-dev \ | ||
libedit-dev \ | ||
libelf-dev \ | ||
libllvm9 \ | ||
llvm-9-dev \ | ||
netperf \ | ||
python3 \ | ||
python3-distutils \ | ||
zlib1g-dev | ||
|
||
RUN cd /var/tmp && git clone -b v${BCC_VERSION} https://github.com/iovisor/bcc.git | ||
RUN mkdir -p /var/tmp/bcc/build && cd /var/tmp/bcc/build | ||
|
||
RUN update-alternatives --install /usr/local/bin/python python /usr/bin/python3.8 1 | ||
|
||
WORKDIR /var/tmp/bcc/build | ||
|
||
RUN cmake .. | ||
RUN make | ||
RUN make install | ||
|
||
# build python3 binding | ||
RUN cmake -DPYTHON_CMD=python3 .. | ||
|
||
WORKDIR /var/tmp/bcc/build/src/python | ||
|
||
RUN make | ||
RUN make install | ||
|
||
RUN mkdir -p /var/tmp/go | ||
WORKDIR /var/tmp/go | ||
RUN apt-get install -y curl | ||
|
||
RUN curl -sSfL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xz | ||
ENV PATH $PATH:/usr/local/go/bin | ||
|
||
RUN mkdir /workspace | ||
WORKDIR /workspace |
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,2 @@ | ||
* | ||
!.gitignore |