Skip to content

Commit

Permalink
Run CI on macos (#80)
Browse files Browse the repository at this point in the history
* Run CI on macos

* add macOS nixpkgs

* conditionally add macos nixpkgs

* reformat nix flake

* Remove non-standard `--echo` option to `pkill`

* Only build bundles for Linux for now

---------

Co-authored-by: Collins Muriuki <hello@collinsmuriuki.xyz>
  • Loading branch information
ThetaSinner and c12i authored Aug 26, 2024
1 parent dd7f883 commit 0f63aa4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 32 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ concurrency:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Maximize build space
if: runner.os == 'Linux'
uses: AdityaGarg8/remove-unwanted-software@v2
with:
remove-dotnet: 'true'
Expand All @@ -26,13 +32,9 @@ jobs:
remove-docker-images: 'true'

- name: Install nix
uses: cachix/install-nix-action@v26
with:
install_url: https://releases.nixos.org/nix/nix-2.20.4/install
extra_nix_config: |
experimental-features = flakes nix-command
uses: cachix/install-nix-action@v27

- uses: cachix/cachix-action@v14
- uses: cachix/cachix-action@v15
with:
name: holochain-wind-tunnel
extraPullNames: holochain-ci
Expand Down Expand Up @@ -74,7 +76,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#zome_call_single_value -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - single_write_many_read
run: |
Expand All @@ -84,7 +86,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#single_write_many_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - dht_sync_lag
run: |
Expand All @@ -94,7 +96,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#dht_sync_lag -- --connection-string ws://localhost:8888 --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - app_install
run: |
Expand All @@ -104,7 +106,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#app_install -- --connection-string ws://localhost:8888 --agents 2 --behaviour minimal:1 --behaviour large:1 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - first_call
run: |
Expand All @@ -114,7 +116,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#first_call -- --connection-string ws://localhost:8888 --agents 1 --behaviour local:1 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_read
run: |
Expand All @@ -124,7 +126,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_query
run: |
Expand All @@ -134,7 +136,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_query -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - local_signals
run: |
Expand All @@ -144,7 +146,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#local_signals -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - write_validated
run: |
Expand All @@ -154,7 +156,7 @@ jobs:
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_validated -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill --echo hc && pkill --echo holochain && pkill --echo lair-keystore
pkill hc && pkill holochain && pkill lair-keystore
- name: Smoke test - trycp_write_validated
run: |
Expand All @@ -171,7 +173,7 @@ jobs:
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill --echo hc-run-local
pkill hc-run-local
- name: Smoke test - remote_call_rate
run: |
Expand All @@ -188,7 +190,7 @@ jobs:
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill --echo hc-run-local
pkill hc-run-local
- name: Smoke test - two_party_countersigning
run: |
Expand All @@ -203,9 +205,10 @@ jobs:
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill --echo hc-run-local
pkill hc-run-local
- name: Build scenario bundles
if: runner.os == 'Linux'
run: |
set -euxo pipefail
Expand All @@ -220,6 +223,7 @@ jobs:
scenario_names | xargs -I % cp % dist/
- name: Archive scenario bundles
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: scenario-bundles
Expand Down
20 changes: 10 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
crane.follows = "crane";
rust-overlay.follows = "rust-overlay";
};


};

tryorama = {
url = "github:holochain/tryorama?ref=v0.17.0-dev.2";
url = "github:holochain/tryorama?ref=v0.17.0-dev.5";
inputs = {
nixpkgs.follows = "nixpkgs";
crane.follows = "crane";
Expand Down Expand Up @@ -84,6 +82,10 @@
inputs'.holonix.packages.rust
inputs'.tryorama.packages.trycp-server
inputs'.amber.packages.default
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
];

shellHook = ''
Expand Down

0 comments on commit 0f63aa4

Please sign in to comment.