forked from TraceMachina/nativelink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove a bunch of unnecessary CI runs and bring them in line with the pattern we're using for native Bazel builds and Nix builds.
- Loading branch information
1 parent
c5c440a
commit 4e960c4
Showing
5 changed files
with
92 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,54 +8,6 @@ on: | |
branches: [ main ] | ||
|
||
jobs: | ||
windows-cargo-tests: | ||
# The type of runner that the job will run on. | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Compile on windows | ||
run: cargo build --all | ||
- name: Test on windows | ||
run: cargo test --all | ||
cargo-tests: | ||
# The type of runner that the job will run on. | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
# Which OS versions we will test on. | ||
os_version: [ 20.04, 22.04 ] | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./deployment-examples/docker-compose/Dockerfile | ||
build-args: | | ||
OS_VERSION=${{ matrix.os_version }} | ||
load: true # This brings the build into `docker images` from buildx. | ||
tags: trace_machina/native-link:dependencies | ||
target: dependencies | ||
|
||
- name: Create container for cargo | ||
run: | | ||
docker run --name=native-link-cargo trace_machina/native-link:dependencies bash -c ' \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y curl libssl-dev gcc pkg-config python3 && \ | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.70.0 \ | ||
' && \ | ||
docker commit native-link-cargo trace_machina/native-link:cargo | ||
- name: Compile & test with cargo | ||
run: | | ||
docker run --rm -w /root/native-link -v $PWD:/root/native-link trace_machina/native-link:cargo bash -c ' \ | ||
. /root/.cargo/env && \ | ||
cargo build --all && \ | ||
cargo test --all \ | ||
' | ||
docker-compose-compiles-native-link: | ||
# The type of runner that the job will run on. | ||
runs-on: ubuntu-22.04 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
name: Cargo Native | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
cargo-native: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-2022, ubuntu-22.04, ubuntu-20.04, macos-13] | ||
toolchain: [stable, beta, nightly] | ||
name: ${{ matrix.os }} / ${{ matrix.toolchain }} | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
||
- name: Checkout | ||
uses: >- # v4.1.1 | ||
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Set up Rust toolchain | ||
run: | | ||
rustup update stable && rustup default stable | ||
shell: bash | ||
|
||
- name: Set up Cargo cache | ||
uses: >- # v3.3.2 | ||
actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-native-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ runner.os }}-cargo- | ||
|
||
- name: Build on ${{ runner.os }} | ||
run: cargo build --all | ||
|
||
- name: Test on ${{ runner.os }} | ||
run: cargo test --all |
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 |
---|---|---|
|
@@ -11,47 +11,50 @@ permissions: read-all | |
|
||
jobs: | ||
nix-bazel: | ||
runs-on: ubuntu-22.04 | ||
runs-on: [ubuntu-22.04, macos-13] | ||
name: ${{ matrix.os }} | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
uses: >- # v4.1.1 | ||
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v22 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- name: Mount Nix cache | ||
uses: actions/[email protected] | ||
with: | ||
key: ${{ runner.os }}-nix | ||
path: ~/nix | ||
uses: >- #v7 | ||
DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 | ||
- name: Cache Nix derivations | ||
uses: >- # Custom commit, last pinned at 2023-11-17. | ||
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1 | ||
- name: Mount bazel cache | ||
uses: actions/cache@v3 | ||
uses: >- # v3.3.2 | ||
actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 | ||
with: | ||
path: "~/.cache/bazel" | ||
key: ${{ runner.os }}-bazel-nix | ||
|
||
- name: Invoke Bazel build in Nix shell | ||
run: > | ||
nix --store ~/nix develop --impure --command | ||
nix develop --impure --command | ||
bash -c "bazel test ..." | ||
nix-cargo: | ||
runs-on: ubuntu-22.04 | ||
runs-on: [ubuntu-22.04, macos-13] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
uses: >- # v4.1.1 | ||
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v22 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- name: Mount Nix cache | ||
uses: actions/[email protected] | ||
with: | ||
key: ${{ runner.os }}-nix | ||
path: ~/nix | ||
uses: >- #v7 | ||
DeterminateSystems/nix-installer-action@5620eb4af6b562c53e4d4628c0b6e4f9d9ae8612 | ||
- name: Cache Nix derivations | ||
uses: >- # Custom commit, last pinned at 2023-11-17. | ||
DeterminateSystems/magic-nix-cache-action@a04e6275a6bea232cd04fc6f3cbf20d4cb02a3e1 | ||
- name: Invoke Cargo build in Nix shell | ||
run: > | ||
nix --store ~/nix develop --impure --command | ||
nix develop --impure --command | ||
bash -c "cargo test --all" |