generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change speeds up our current CI pipeline by a lot (20min -> 2min). We are using a self hosted S3 cache on hetzner and a single large server, also hosted on S3. The main reason our old CI system was slow is that we have a large amount of toolchains that are not installed by default on the github runners. That means that every job in the CI has to download about 10Gb of data, just for the toolchains. The new system is way faster, we have a single server with nix installed. On this server there are multiple github runners. Each of them share a single nix store. They also share the gradle caches in the home directory. The build artifacts are cached to S3 which is both local and cheap. Signed-off-by: Felix Hilgers <[email protected]>
- Loading branch information
Showing
5 changed files
with
154 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# SPDX-FileCopyrightText: 2024 Felix Hilgers <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: PR | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [main, dev] | ||
|
||
env: | ||
RUSTFLAGS: "-Dwarnings" | ||
CARGO_INCREMENTAL: 0 | ||
|
||
jobs: | ||
|
||
reuse-lint: | ||
name: Reuse Lint | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Reuse Lint | ||
run: nix develop --command reuse lint | ||
|
||
sbom: | ||
name: Generate Sbom | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate Sbom | ||
run: nix develop --command python utils/generate_sbom.py | ||
|
||
rust-lint: | ||
name: Rust Lint | ||
runs-on: self-hosted | ||
needs: [reuse-lint] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-rust-cache | ||
with: | ||
accessKey: ${{ secrets.CACHE_ACCESS_KEY }} | ||
secretKey: ${{ secrets.CACHE_SECRET_KEY }} | ||
|
||
- name: Cargo Clippy | ||
run: | | ||
cd rust | ||
nix develop --command cargo clippy --all-targets --all-features | ||
rust-test: | ||
name: Rust Tests | ||
runs-on: self-hosted | ||
needs: [rust-lint] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-rust-cache | ||
with: | ||
accessKey: ${{ secrets.CACHE_ACCESS_KEY }} | ||
secretKey: ${{ secrets.CACHE_SECRET_KEY }} | ||
|
||
- name: Cargo test | ||
run: | | ||
cd rust | ||
nix develop --command cargo test --workspace --all-targets --all-features --exclude backend-daemon | ||
rust-build: | ||
name: Rust Build | ||
runs-on: self-hosted | ||
needs: [rust-test] | ||
strategy: | ||
matrix: | ||
target: [arm64-v8a, x86_64] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-rust-cache | ||
with: | ||
accessKey: ${{ secrets.CACHE_ACCESS_KEY }} | ||
secretKey: ${{ secrets.CACHE_SECRET_KEY }} | ||
cacheKey: ${{ matrix.target }} | ||
|
||
- name: Cargo Build Daemon ${{ matrix.target }} | ||
run: | | ||
cd rust | ||
nix develop --command cargo ndk --target ${{ matrix.target }} build --package backend-daemon --package client | ||
gradle-build: | ||
name: Gradle Build | ||
runs-on: self-hosted | ||
needs: [reuse-lint] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-rust-cache | ||
with: | ||
accessKey: ${{ secrets.CACHE_ACCESS_KEY }} | ||
secretKey: ${{ secrets.CACHE_SECRET_KEY }} | ||
- uses: ./.github/actions/setup-gradle-cache | ||
with: | ||
accessKey: ${{ secrets.CACHE_ACCESS_KEY }} | ||
secretKey: ${{ secrets.CACHE_SECRET_KEY }} | ||
|
||
- name: Gradle Lint | ||
run: | | ||
cd frontend | ||
nix develop --command ./gradlew build --no-daemon --parallel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters