Fix makefile and CI #20
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
name: ci | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build-and-lint: | |
name: Build and Lint | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21.x" | |
check-latest: true | |
- name: Static Check | |
run: | | |
if ! command -v staticcheck &> /dev/null; then | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
fi | |
staticcheck ./... | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Install LLVM | |
env: | |
LLVM_VERSION: "15.0.7" | |
run: | | |
ID="$(docker create --name llvm ghcr.io/vietanhduong/wbpf-llvm:${LLVM_VERSION} bash -l)" | |
sudo docker cp "$ID:/usr/local/bin/clang" /usr/local/bin | |
sudo docker cp "$ID:/usr/local/bin/clang-amd64" /usr/local/bin | |
sudo docker cp "$ID:/usr/local/bin/clang-arm64" /usr/local/bin | |
docker rm $ID | |
- name: Run Test | |
run: | | |
sudo apt-get install -y make && \ | |
make test && | |
make build-examples |