diff --git a/.github/workflows/motoko-encrypted-notes-vetkd-example.yml b/.github/workflows/motoko-encrypted-notes-vetkd-example.yml index 4464e8a34..165486d14 100644 --- a/.github/workflows/motoko-encrypted-notes-vetkd-example.yml +++ b/.github/workflows/motoko-encrypted-notes-vetkd-example.yml @@ -6,7 +6,7 @@ on: pull_request: paths: - motoko/encrypted-notes-dapp-vetkd/** - - motoko/encrypted-notes-dapp-vetkd/provision-darwin.sh + - .github/workflows/provision-darwin.sh - .github/workflows/provision-linux.sh - .github/workflows/motoko-encrypted-notes-vetkd-example.yml concurrency: @@ -19,8 +19,8 @@ jobs: - uses: actions/checkout@v1 - name: Provision Darwin env: - DFX_VERSION: 0.14.2 - run: bash motoko/encrypted-notes-dapp-vetkd/provision-darwin.sh + NODE_VERSION: 14.21.3 + run: bash .github/workflows/provision-darwin.sh - name: Motoko Encrypted Notes Darwin (unit tests) run: | pushd motoko/encrypted-notes-dapp-vetkd diff --git a/.github/workflows/motoko-hello_cycles-example.yaml b/.github/workflows/motoko-hello_cycles-example.yaml index c42e63f89..6fc0e15b8 100644 --- a/.github/workflows/motoko-hello_cycles-example.yaml +++ b/.github/workflows/motoko-hello_cycles-example.yaml @@ -21,7 +21,7 @@ jobs: run: bash .github/workflows/provision-darwin.sh - name: Motoko Hello Cycles Darwin run: | - dfx upgrade + dfxvm update dfx start --background --clean pushd motoko/hello_cycles make test @@ -34,7 +34,7 @@ jobs: run: bash .github/workflows/provision-linux.sh - name: Motoko Hello Cycles Linux run: | - dfx upgrade + dfxvm update dfx start --background --clean pushd motoko/hello_cycles make test diff --git a/.github/workflows/provision-darwin.sh b/.github/workflows/provision-darwin.sh index e62d308d1..690a87893 100755 --- a/.github/workflows/provision-darwin.sh +++ b/.github/workflows/provision-darwin.sh @@ -17,9 +17,11 @@ sudo installer -pkg node.pkg -store -target / rm node.pkg # Install DFINITY SDK. -curl --location --output install-dfx.sh "https://internetcomputer.org/install.sh" -DFX_VERSION=${DFX_VERSION:=0.16.1} bash install-dfx.sh < <(yes Y) +curl --location --output install-dfx.sh "https://raw.githubusercontent.com/dfinity/sdk/dfxvm-install-script/install.sh" +DFX_VERSION=${DFX_VERSION:=0.16.1} DFXVM_INIT_YES=true bash install-dfx.sh rm install-dfx.sh +echo "$HOME/Library/Application Support/org.dfinity.dfx/bin" >> $GITHUB_PATH +source "$HOME/Library/Application Support/org.dfinity.dfx/env" dfx cache install # Install ic-repl diff --git a/.github/workflows/provision-linux.sh b/.github/workflows/provision-linux.sh index d37ddf99f..01150ec9d 100755 --- a/.github/workflows/provision-linux.sh +++ b/.github/workflows/provision-linux.sh @@ -12,9 +12,11 @@ sudo apt-get install --yes nodejs rm install-node.sh # Install DFINITY SDK. -wget --output-document install-dfx.sh "https://internetcomputer.org/install.sh" -DFX_VERSION=${DFX_VERSION:=0.16.1} bash install-dfx.sh < <(yes Y) +wget --output-document install-dfx.sh "https://raw.githubusercontent.com/dfinity/sdk/dfxvm-install-script/install.sh" +DFX_VERSION=${DFX_VERSION:=0.16.1} DFXVM_INIT_YES=true bash install-dfx.sh rm install-dfx.sh +echo "$HOME/.local/share/dfx/bin" >> $GITHUB_PATH +source "$HOME/.local/share/dfx/env" dfx cache install # Install ic-repl diff --git a/.github/workflows/rust-encrypted-notes-vetkd-example.yml b/.github/workflows/rust-encrypted-notes-vetkd-example.yml index d1f4f669d..63ed15e4e 100644 --- a/.github/workflows/rust-encrypted-notes-vetkd-example.yml +++ b/.github/workflows/rust-encrypted-notes-vetkd-example.yml @@ -6,7 +6,7 @@ on: pull_request: paths: - motoko/encrypted-notes-dapp-vetkd/** - - motoko/encrypted-notes-dapp-vetkd/provision-darwin.sh + - .github/workflows/provision-darwin.sh - .github/workflows/provision-linux.sh - .github/workflows/rust-encrypted-notes-vetkd-example.yml concurrency: @@ -20,7 +20,8 @@ jobs: - name: Provision Darwin env: DFX_VERSION: 0.14.2 - run: bash motoko/encrypted-notes-dapp-vetkd/provision-darwin.sh + NODE_VERSION: 14.21.3 + run: bash .github/workflows/provision-darwin.sh - name: Rust Encrypted Notes Darwin (unit tests) run: | pushd motoko/encrypted-notes-dapp-vetkd diff --git a/.github/workflows/rust-send-http-get-example.yml b/.github/workflows/rust-send-http-get-example.yml index 6cc6fbbe3..4ae5bbf84 100644 --- a/.github/workflows/rust-send-http-get-example.yml +++ b/.github/workflows/rust-send-http-get-example.yml @@ -21,7 +21,7 @@ jobs: run: bash .github/workflows/provision-darwin.sh - name: Rust Send HTTP GET Darwin run: | - dfx upgrade + dfxvm update dfx start --background pushd rust/send_http_get RUSTFLAGS=-Ctarget-cpu=mvp make test @@ -34,7 +34,7 @@ jobs: run: bash .github/workflows/provision-linux.sh - name: Rust Send HTTP GET Linux run: | - dfx upgrade + dfxvm update dfx start --background pushd rust/send_http_get RUSTFLAGS=-Ctarget-cpu=mvp make test diff --git a/.github/workflows/rust-send-http-post-example.yml b/.github/workflows/rust-send-http-post-example.yml index d0c989787..a7194e7b4 100644 --- a/.github/workflows/rust-send-http-post-example.yml +++ b/.github/workflows/rust-send-http-post-example.yml @@ -21,7 +21,7 @@ jobs: run: bash .github/workflows/provision-darwin.sh - name: Rust Send HTTP POST Darwin run: | - dfx upgrade + dfxvm update dfx start --background pushd rust/send_http_post RUSTFLAGS=-Ctarget-cpu=mvp make test @@ -34,7 +34,7 @@ jobs: run: bash .github/workflows/provision-linux.sh - name: Rust Send HTTP POST Linux run: | - dfx upgrade + dfxvm update dfx start --background pushd rust/send_http_post RUSTFLAGS=-Ctarget-cpu=mvp make test diff --git a/motoko/encrypted-notes-dapp-vetkd/provision-darwin.sh b/motoko/encrypted-notes-dapp-vetkd/provision-darwin.sh deleted file mode 100755 index 02052fed9..000000000 --- a/motoko/encrypted-notes-dapp-vetkd/provision-darwin.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -set -ex - -# Enter temporary directory. -pushd /tmp - -# Install Homebrew -curl --location --output install-brew.sh "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" -bash install-brew.sh -rm install-brew.sh - -# Install Node. -version=14.21.3 -curl --location --output node.pkg "https://nodejs.org/dist/v$version/node-v$version.pkg" -sudo installer -pkg node.pkg -store -target / -rm node.pkg - -# Install DFINITY SDK. -curl --location --output install-dfx.sh "https://internetcomputer.org/install.sh" -DFX_VERSION=${DFX_VERSION:=0.12.0} bash install-dfx.sh < <(yes Y) -rm install-dfx.sh -dfx cache install - -# Install ic-repl -version=0.1.2 -curl --location --output ic-repl "https://github.com/chenyan2002/ic-repl/releases/download/$version/ic-repl-macos" -mv ./ic-repl /usr/local/bin/ic-repl -chmod a+x /usr/local/bin/ic-repl - -# Install cmake -brew install cmake - -# Install rust -curl --location --output install-rustup.sh "https://sh.rustup.rs" -bash install-rustup.sh -y -rustup target add wasm32-unknown-unknown - -# Install matchers -matchers_version=1.2.0 -curl -fsSLO "https://github.com/kritzcreek/motoko-matchers/archive/refs/tags/v${matchers_version}.tar.gz" -tar -xzf "v${matchers_version}.tar.gz" --directory "$(dfx cache show)" -rm "v${matchers_version}.tar.gz" -mv "$(dfx cache show)/motoko-matchers-${matchers_version}" "$(dfx cache show)/motoko-matchers" - -# Install wasmtime -wasmtime_version=0.33.1 -curl -fsSLO "https://github.com/bytecodealliance/wasmtime/releases/download/v${wasmtime_version}/wasmtime-v${wasmtime_version}-x86_64-macos.tar.xz" -mkdir -p "${HOME}/bin" -tar -xf "wasmtime-v${wasmtime_version}-x86_64-macos.tar.xz" --directory "${HOME}/bin/" -mv "${HOME}/bin/wasmtime-v${wasmtime_version}-x86_64-macos/wasmtime" "${HOME}/bin/wasmtime" -rm "wasmtime-v${wasmtime_version}-x86_64-macos.tar.xz" - -# Exit temporary directory. -popd