Skip to content

Commit

Permalink
split build-tools and build in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin JEROME <[email protected]>
  • Loading branch information
qjerome committed Oct 7, 2023
1 parent 9e03e6a commit bfa131f
Showing 1 changed file with 40 additions and 5 deletions.
45 changes: 40 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:

build-tools:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -31,7 +30,8 @@ jobs:
~/.cargo
~/.rustup
target
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock', '**/.github/workflows/ci.yml') }}
# if xtask changed maybe linker version changed so we don't want old objects to mess with new ones
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock', '**/.github/workflows/ci.yml', '**/xtask/') }}

- id: cache-key
run: echo "cache-key=$(cargo xtask build-tools --action-cache-key)" >> "$GITHUB_OUTPUT"
Expand All @@ -42,9 +42,43 @@ jobs:
path: |
build-tools/
key: ${{ steps.cache-key.outputs.cache-key }}

- name: Build-Tools (LLVM and bpf-linker)
run: cargo xtask build-tools --free-space

build:
needs: build-tools
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install system tools
run: |
sudo apt update
sudo apt install -y qemu-system-x86 cmake ninja-build clang lld git libbpf-dev
# we need to fetch rust deps first to speed up cargo xtask
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo
~/.rustup
target
# if xtask changed maybe linker version changed so we don't want old objects to mess with new ones
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock', '**/.github/workflows/ci.yml', '**/xtask/') }}

- id: cache-key
run: echo "cache-key=$(cargo xtask build-tools --action-cache-key)" >> "$GITHUB_OUTPUT"

- name: Cache build tools
uses: actions/cache@v3
with:
path: |
build-tools/
key: ${{ steps.cache-key.outputs.cache-key }}

- name: Build (eBPF and userland)
run: cargo xtask build --release
Expand All @@ -60,3 +94,4 @@ jobs:

- name: Linux Kernel LTS 6.1
run: ./scripts/ci/test_kernel.sh 6.1

0 comments on commit bfa131f

Please sign in to comment.