Skip to content

Commit

Permalink
github: bump to ubuntu 22.04 & LLVM 17
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird committed Aug 8, 2023
1 parent 400f19c commit d0cbf6a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: ./.github/workflows/llvm.yml

lint-stable:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
Expand All @@ -34,7 +34,7 @@ jobs:
run: cargo clippy --features llvm-sys/no-llvm-linking --all-targets --workspace -- --deny warnings

lint-nightly:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
Expand All @@ -48,7 +48,7 @@ jobs:
run: cargo fmt --all -- --check

build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
Expand All @@ -57,7 +57,7 @@ jobs:
- beta
- nightly
llvm:
- 16
- 17
- source
name: rustc=${{ matrix.rust }} llvm=${{ matrix.llvm }}
needs: llvm
Expand Down Expand Up @@ -91,28 +91,32 @@ jobs:

- name: Install dependencies
if: matrix.rust == 'nightly'
# ubuntu-20.04 comes with clang prior to
# https://github.com/llvm/llvm-project/commit/6d6750696400 which does not implement
# __builtin_preserve_enum_value, used by relocation tests in aya.
# ubuntu-22.04 comes with clang 14[0] which doesn't include support for signed and 64bit
# enum values which was added in clang 15[1].
#
# gcc-multilib provides at least <asm/types.h> which is referenced by libbpf.
#
# llvm provides llvm-objcopy which is used to build the BTF relocation tests.
#
# [0] https://github.com/actions/runner-images/blob/ubuntu22/20230724.1/images/linux/Ubuntu2204-Readme.md
#
# [1] https://github.com/llvm/llvm-project/commit/dc1c43d
run: |
set -euxo pipefail
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo -e deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main | sudo tee /etc/apt/sources.list.d/llvm.list
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get -y install clang-16 gcc-multilib
echo /usr/lib/llvm-16/bin >> $GITHUB_PATH
sudo apt-get -y install clang gcc-multilib
- name: Install LLVM
if: matrix.llvm != 'source'
run: |
set -euxo pipefail
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo -e deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.llvm }} main | sudo tee /etc/apt/sources.list.d/llvm.list
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo -e deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.llvm }} main | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get -y install llvm-${{ matrix.llvm }}-dev
sudo apt update
sudo apt -y install llvm-${{ matrix.llvm }}-dev
echo /usr/lib/llvm-${{ matrix.llvm }}/bin >> $GITHUB_PATH
- name: Restore LLVM
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:

jobs:
llvm:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: llvm
outputs:
cache-key: ${{ steps.cache-key.outputs.cache-key }}
steps:
- id: ls-remote
run: |
set -euxo pipefail
value=$(git ls-remote https://github.com/aya-rs/llvm-project.git refs/heads/rustc/16.0-2023-06-05 | cut -f1)
value=$(git ls-remote https://github.com/aya-rs/llvm-project.git refs/heads/rustc/17.0-2023-07-29 | cut -f1)
echo "sha=$value" >> "$GITHUB_OUTPUT"
- id: cache-key
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

upload-bins:
# TODO: Build for macos someday.
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: llvm
steps:
- name: Restore LLVM
Expand Down

0 comments on commit d0cbf6a

Please sign in to comment.