Skip to content

Commit

Permalink
WIP github actions
Browse files Browse the repository at this point in the history
2nd try

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
  • Loading branch information
lmb committed Sep 14, 2023
1 parent 74e1d7b commit d636c1a
Showing 1 changed file with 93 additions and 0 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI Build

on: [ push, pull_request ]
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]

env:
TMPDIR: /tmp
CI_MAX_KERNEL_VERSION: '6.1'
CI_MIN_CLANG_VERSION: '9'
go_version: '~1.21'
prev_go_version: '~1.20'

jobs:
build-and-lint:
name: Build and Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '${{ env.go_version }}'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.7.0

- run: make clean && make container-all
- run: git diff --exit-code || { echo "found unformatted source files, or generated files are not up to date, run 'make'" >&2; false; }
- run: go build -v -o "$(mktemp -d)" ./...
working-directory: ./examples

cross-build:
name: Cross build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- GOOS: darwin
- GOARCH: arm
GOARM: 6
- GOARCH: arm64
env:
GOOS: '${{ matrix.GOOS }}'
GOARCH: '${{ matrix.GOARCH }}'
GOARM: '${{ matrix.GOARM }}'
steps:
- run: go build ./...
- run: for p in $(go list ./...) ; do go test -c $p || exit ; done

# test-on-prev-go:
# name: Run unit tests on previous stable Go
# runs-on: ubuntu-latest-4cores-16gb
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v3

# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: '${{ env.prev_go_version }}'

# - name: Install prerequisites
# run: |
# go install gotest.tools/gotestsum@v1.8.1
# sudo pip3 install https://github.com/amluto/virtme/archive/beb85146cd91de37ae455eccb6ab67c393e6e290.zip
# sudo apt-get install -y --no-install-recommends qemu-system-x86 clang-9 llvm-9

# - name: Build
# run: |
# go test -v ./cmd/bpf2go
# gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- ./run-tests.sh $CI_MAX_KERNEL_VERSION -short -count 1 -json ./...

# vmtest:
# runs-on: ubuntu-latest-4cores-16gb
# timeout-minutes: 10
# steps:
# - uses: actions/checkout@v3

# - name: Set up Go
# uses: actions/setup-go@v4
# with:
# go-version: '${{ env.go_version }}'

# - name: Build
# run: go build -v ./...

# - name: Test
# run: go test -v ./...

0 comments on commit d636c1a

Please sign in to comment.