Skip to content

Commit

Permalink
chore: bump ubuntu images, go, clang, actions...
Browse files Browse the repository at this point in the history
clang-format pinned to the same version of the clang compiler.

Co-authored-by: Raphael Campos <raphael@pod8.io>
  • Loading branch information
geyslan and rscampos committed May 24, 2024
1 parent 7b0db19 commit c550084
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 30 deletions.
11 changes: 5 additions & 6 deletions .github/actions/build-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ description: |
inputs:
go-version:
description: go version
default: "1.21"
default: "1.22.3"
runs:
using: composite
steps:
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: "${{ inputs.go-version }}"
- name: Install Compilers & Formatters
Expand All @@ -18,12 +18,11 @@ runs:
sudo apt-get install --yes bsdutils
sudo apt-get install --yes build-essential
sudo apt-get install --yes pkgconf
sudo apt-get install --yes llvm-12 clang-12
sudo apt-get install --yes clang-format-12
sudo apt-get install --yes llvm-14 clang-14
sudo apt-get install --yes zlib1g-dev libelf-dev
for tool in "clang" "llc" "llvm-strip" "clang-format"
for tool in "clang" "clang-format" "llc" "llvm-strip"
do
sudo rm -f /usr/bin/$tool
sudo ln -s /usr/bin/$tool-12 /usr/bin/$tool
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool
done
shell: bash
22 changes: 11 additions & 11 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
jobs:
analyze-code:
name: Analyze Code
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Install Dependencies
uses: ./.github/actions/build-dependencies
- name: Lint
Expand Down Expand Up @@ -54,13 +54,13 @@ jobs:
shell: bash
libbpfgo-unit-tests:
name: libbpfgo Unit Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
go-version: [ 1.18, 1.19, '1.20', '1.21', 'stable' ]
go-version: [ '1.21', '1.22', 'stable' ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Install Dependencies
uses: ./.github/actions/build-dependencies
with:
Expand All @@ -70,13 +70,13 @@ jobs:
make libbpfgo-static-test
helpers-unit-tests:
name: Helpers Unit Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
go-version: [ 1.18, 1.19, '1.20', '1.21', 'stable' ]
go-version: [ '1.21', '1.22', 'stable' ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Install Dependencies
uses: ./.github/actions/build-dependencies
with:
Expand All @@ -86,13 +86,13 @@ jobs:
make helpers-test-static-run
self-tests:
name: Selftests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
go-version: [ 1.18, 1.19, '1.20', '1.21', 'stable' ]
go-version: [ '1.21', '1.22', 'stable' ]
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Install Dependencies
uses: ./.github/actions/build-dependencies
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CLANG := clang
CC := $(CLANG)
GO := go
VAGRANT := vagrant
CLANG_FMT := clang-format-12
CLANG_FMT := clang-format-14
GIT := $(shell which git || /bin/false)
REVIVE := revive
PKGCONFIG := pkg-config
Expand Down
4 changes: 2 additions & 2 deletions builder/Vagrantfile-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ VM_SOURCE = "/vagrant"
Vagrant.configure("2") do |config|
case ARCH
when "amd64"
config.vm.box = "ubuntu/jammy64"
config.vm.box = "bento/ubuntu-24.04"
when "arm64"
config.vm.box = "bento/ubuntu-22.04-arm64"
config.vm.box = "bento/ubuntu-24.04"
end

case HOSTOS
Expand Down
23 changes: 18 additions & 5 deletions builder/prepare-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@

# variables

[ -z "${GO_VERSION}" ] && GO_VERSION="1.21"
[ -z "${CLANG_VERSION}" ] && CLANG_VERSION="12"
[ -z "${ARCH}" ] && ARCH="amd64"
[ -z "${GO_VERSION}" ] && GO_VERSION="1.22"
[ -z "${CLANG_VERSION}" ] && CLANG_VERSION="14"
[ -z "${ARCH}" ] && ARCH=$(uname -m)

case "${ARCH}" in
x86_64|amd64)
ARCH="amd64"
;;
aarch64|arm64)
ARCH="arm64"
;;
*)
die "unsupported architecture ${ARCH}"
;;
esac


# functions
Expand Down Expand Up @@ -59,7 +71,7 @@ setup_go() {
setup_clang() {
info "Setting Clang ${CLANG_VERSION} as default"

local tools="clang llc llvm-strip clang-format"
local tools="clang clang-format llc llvm-strip"
for tool in ${tools}
do
sudo -E update-alternatives --install "/usr/bin/${tool}" "${tool}" "/usr/bin/${tool}-${CLANG_VERSION}" 100
Expand All @@ -79,7 +91,8 @@ install_pkgs \
coreutils bsdutils findutils \
build-essential pkgconf \
golang-"${GO_VERSION}"-go \
llvm-"${CLANG_VERSION}" clang-"${CLANG_VERSION}" clang-format-"${CLANG_VERSION}" \
llvm-"${CLANG_VERSION}" clang-"${CLANG_VERSION}" \
clang-format-"${CLANG_VERSION}" \
linux-headers-generic \
linux-tools-generic linux-tools-"$(uname -r)" \
libbpf-dev libelf-dev libzstd-dev zlib1g-dev
Expand Down
9 changes: 4 additions & 5 deletions docs/Vagrantfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

## Boxes

Currently there are two boxes available in [Vagrantfile-ubuntu](./../builder/Vagrantfile-ubuntu):
Currently there is one box available in [Vagrantfile-ubuntu](./../builder/Vagrantfile-ubuntu):

| Box | Providers |
|----------------------------------------------------------------------------------------------|--------------------------|
| [generic/ubuntu2204](https://app.vagrantup.com/generic/boxes/ubuntu2204) (amd64) | virtualbox, parallels |
| [jharoian3/ubuntu-22.04-arm64](https://app.vagrantup.com/jharoian3/boxes/ubuntu-22.04-arm64) | parallels |
| Box | Providers |
|--------------------------------------------------------------------------|--------------------------|
| [bento/ubuntu-24.04](https://app.vagrantup.com/bento/boxes/ubuntu-24.04) | virtualbox (amd64), parallels (arm64,amd64), ...|

It is recommended to use them through the respective [Makefile rules](../Readme.md#contributing) as they are or overriding the `ARCH` environment variable if your architecture and provider allow such virtualization. E.g.: `make vagrant-up ARCH=amd64`.

Expand Down

0 comments on commit c550084

Please sign in to comment.