Skip to content

Commit

Permalink
CI: Only run with nix remote for ubuntu
Browse files Browse the repository at this point in the history
Previously, this would also run for macos-12, but without having any effect.
  • Loading branch information
avdv committed Jul 10, 2024
1 parent fef7422 commit d5edf1e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ jobs:
- true
- false
withNixRemote:
- true
- false
include:
- os: ubuntu-latest
withNixRemote: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -39,7 +41,7 @@ jobs:
with:
buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Start remote Nix server
if: matrix.withNixRemote && matrix.os == 'ubuntu-latest'
if: matrix.withNixRemote
run: |
# Generate temporary SSH keys.
mkdir -p $HOME/.ssh
Expand All @@ -52,16 +54,13 @@ jobs:
cp .github/nix-server/keys/* $HOME/.ssh/
sudo cp .github/nix-server/config /etc/ssh/ssh_config
echo "Setting BAZEL_NIX_REMOTE env variable"
echo BAZEL_NIX_REMOTE=nix-server >> "$GITHUB_ENV"
- name: Build & test
env:
BZLMOD_ENABLED: ${{ matrix.bzlmodEnabled }}
NIX_REMOTE_ENABLED: matrix.withNixRemote && matrix.os == 'ubuntu-latest'
run: |
if [ "$NIX_REMOTE_ENABLED" = "true" ]; then
echo "Setting BAZEL_NIX_REMOTE env variable"
export BAZEL_NIX_REMOTE=nix-server
fi
nix-shell --pure \
--keep GITHUB_STEP_SUMMARY \
--keep GITHUB_REPOSITORY \
Expand Down

0 comments on commit d5edf1e

Please sign in to comment.