fix duplicate spacing #2712
Workflow file for this run
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
name: ic-ref | |
on: | |
push: | |
branches: | |
- next | |
pull_request_target: | |
# Also run on every pull_request that changes the workflow, as the repo. | |
pull_request: | |
paths: | |
- '.github/**' | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: [ linux-stable ] | |
include: | |
- build: linux-stable | |
ghc: '8.8.4' | |
spec: '0.16.0' | |
os: ubuntu-latest | |
rust: 1.47.0 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: main | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: actions/checkout@v2 | |
with: | |
repository: 'dfinity-lab/ic-ref' | |
# Personal Read-only Access Token created by [email protected] | |
token: ${{ secrets.IC_REF_TOKEN }} | |
path: ic-ref | |
ref: ${{ matrix.spec }} | |
- uses: actions/checkout@v2 | |
with: | |
repository: 'dfinity/wallet-rs' | |
# Personal Read-only Access Token created by [email protected] | |
token: ${{ secrets.IC_REF_TOKEN }} | |
path: wallet-rs | |
ref: f41159994be17c2832a3f4b55b6aa38bef506156 | |
- name: Cache ~/.cabal/store | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cabal/store | |
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-store | |
- uses: actions/[email protected] | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: '3.2' | |
- name: Cargo cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Rust | |
run: | | |
rustup update ${{ matrix.rust }} --no-self-update | |
rustup default ${{ matrix.rust }} | |
rustup target add wasm32-unknown-unknown | |
- name: Build ic-ref | |
run: | | |
ls -l /opt/ghc/ | |
export PATH=/opt/ghc/bin:$PATH | |
cabal --version | |
ghc-${{ matrix.ghc }} --version | |
mkdir -p $HOME/bin | |
cd ic-ref/impl | |
cabal update | |
cabal install exe:ic-ref -w ghc-${{ matrix.ghc }} --overwrite-policy=always --installdir=$HOME/bin | |
- name: Build universal-canister | |
run: | | |
cd ic-ref/universal-canister | |
cargo build --target wasm32-unknown-unknown --release | |
cp target/wasm32-unknown-unknown/release/universal_canister.wasm $HOME/canister.wasm | |
- name: Build wallet canister | |
run: | | |
cd wallet-rs/ | |
sh ./wallet/build.sh | |
cp wallet/target/wasm32-unknown-unknown/release/wallet-opt.wasm $HOME/wallet.wasm | |
- name: Run Integration Tests | |
run: | | |
set -ex | |
$HOME/bin/ic-ref --pick-port --write-port-to $HOME/ic_ref_port & | |
sleep 1 | |
export IC_REF_PORT=$(cat $HOME/ic_ref_port) | |
export IC_UNIVERSAL_CANISTER_PATH=$HOME/canister.wasm | |
export IC_WALLET_CANISTER_PATH=$HOME/wallet.wasm | |
cd main/ref-tests | |
cargo test --all-features -- --ignored | |
killall ic-ref | |
env: | |
RUST_BACKTRACE: 1 | |
- name: Install and Configure SoftHSM | |
run: | | |
set -ex | |
sudo apt-get install -f libsofthsm2 opensc-pkcs11 opensc | |
sudo usermod -a -G softhsm $USER | |
echo "SOFTHSM2_CONF=$HOME/softhsm.conf" >>$GITHUB_ENV | |
echo "directories.tokendir = $HOME/softhsm/tokens/" >$HOME/softhsm.conf | |
mkdir -p $HOME/softhsm/tokens | |
- name: Run Integration Tests with SoftHSM | |
run: | | |
set -ex | |
softhsm2-util --init-token --slot $HSM_SLOT_INDEX --label "agent-rs-token" --so-pin $HSM_SO_PIN --pin $HSM_PIN | |
# create key: | |
pkcs11-tool -k --module $HSM_PKCS11_LIBRARY_PATH --login --slot-index $HSM_SLOT_INDEX -d $HSM_KEY_ID --key-type EC:prime256v1 --pin $HSM_PIN | |
$HOME/bin/ic-ref --pick-port --write-port-to $HOME/ic_ref_port & | |
sleep 1 | |
export IC_REF_PORT=$(cat $HOME/ic_ref_port) | |
export IC_UNIVERSAL_CANISTER_PATH=$HOME/canister.wasm | |
export IC_WALLET_CANISTER_PATH=$HOME/wallet.wasm | |
cd main/ref-tests | |
cargo test --all-features -- --ignored --nocapture --test-threads=1 | |
killall ic-ref | |
env: | |
RUST_BACKTRACE: 1 | |
HSM_PKCS11_LIBRARY_PATH: /usr/lib/softhsm/libsofthsm2.so | |
HSM_SO_PIN: 123456 | |
HSM_PIN: 1234 | |
HSM_SLOT_INDEX: 0 | |
HSM_KEY_ID: abcdef | |
- name: Run Doc Tests | |
run: | | |
set -ex | |
$HOME/bin/ic-ref --pick-port --write-port-to $HOME/ic_ref_port & | |
sleep 1 | |
export IC_REF_PORT=$(cat $HOME/ic_ref_port) | |
cd main | |
cargo test --all-features --doc -- --ignored | |
killall ic-ref | |
env: | |
RUST_BACKTRACE: 1 |