Skip to content

more changes

more changes #56

Workflow file for this run

name: Build
on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
env:
# renovate: datasource=go depName=mvdan.cc/gofumpt
GOFUMPT_VERSION: v0.5.0
# renovate: datasource=go depName=github.com/golangci/golangci-lint
GOLANGCI_LINT_VERSION: v1.52.2
# renovate: datasource=go depName=github.com/florianl/bluebox
BLUEBOX_VERSION: v0.0.1
jobs:
skip-check:
name: Skip check
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip-check.outputs.should_skip }}
permissions:
actions: write
contents: read
steps:
- id: skip-check
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 # v5.3.0
with:
do_not_skip: '["schedule", "workflow_dispatch"]'
paths: |-
[
"**.go",
".github/workflows/build.yml",
".go-version",
"3rdparty",
"Makefile",
"bpf/**",
"go.mod",
"go.sum",
"kerneltest/**"
]
skip_after_successful_duplicate: false
go-build-test:
name: Go Build
runs-on: ubuntu-latest
needs: skip-check
if: ${{ needs.skip-check.outputs.should_skip != 'true' }}
steps:
- name: Check out the code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set up Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version-file: .go-version
cache: true
- name: Set up Clang
uses: KyleMayes/install-llvm-action@13d5d77cbf0bd7e35cb02a8f9ed4bb85bed3393b # v1.8.0
with:
version: "14"
- name: clang version
run: |
clang -v
ld --version
ld.lld --version
- name: Set up gofumpt
run: go install "mvdan.cc/gofumpt@${GOFUMPT_VERSION}"
- name: Install clang-format
run: sudo apt-get install clang-format
- name: Show clang-format version
run: clang-format --version
- name: Install libbpf dependencies
run: |
sudo apt-get update -y
sudo apt-get install -yq libelf-dev zlib1g-dev
- name: Initialize and update git submodules
run: git submodule init && git submodule update
- name: Build libbpf
run: make libbpf
- name: Build BPF
run: make bpf
- name: Build
run: make build
- name: Show kernel version
run: uname -a
- name: Show Go version
run: |
which go
go version
go env
echo $PATH
- name: Test
# Some of the GH action CI machines have several versions of Go installed.
# Make sometimes somehow resolves different Go. We need to specify explicitly.
run: make GO=`which go` test ENABLE_RACE=yes
- name: Test unwind tables
run: make test-dwarf-unwind-tables
- name: Format
run: make format-check
- name: Install golangci-lint
run: go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}"
- name: Lint
run: make go/lint
- name: Build initramfs
run: |
go install "github.com/florianl/bluebox@${BLUEBOX_VERSION}"
make initramfs
- name: Upload initramfs
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: initramfs
path: |
kerneltest/initramfs.cpio
vmtest:
name: kernel tests
runs-on: ubuntu-latest
needs: go-build-test
if: ${{ needs.skip-check.outputs.should_skip != 'true' }}
steps:
- name: Check out the code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt -y install qemu-system-x86 curl
- name: Download previously generated initramfs
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: initramfs
path: kerneltest/
- name: Run vmtests
run: ./kerneltest/vmtest.sh