bump moc (#184) #565
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: Backend | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
paths: | |
- 'service/**' | |
- '.github/workflows/backend.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
env: | |
DFX_VERSION: 0.14.2 | |
IC_REPL_VERSION: 0.4.1 | |
MOC_VERSION: 0.9.5 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
target: wasm32-unknown-unknown | |
- name: Cache cargo build | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
service/wasm-utils/target | |
key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dfx | |
run: | | |
echo y | DFX_VERSION=$DFX_VERSION bash -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)" | |
wget https://github.com/chenyan2002/ic-repl/releases/download/$IC_REPL_VERSION/ic-repl-linux64 | |
cp ./ic-repl-linux64 /usr/local/bin/ic-repl | |
chmod a+x /usr/local/bin/ic-repl | |
npm i -g ic-mops | |
dfx cache install | |
cd $(dfx cache show) | |
wget https://github.com/dfinity/motoko/releases/download/$MOC_VERSION/motoko-linux64-$MOC_VERSION.tar.gz | |
tar zxvf motoko-linux64-$MOC_VERSION.tar.gz | |
- name: Start dfx | |
run: | | |
dfx start --background | |
- name: Deploy main branch | |
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking_changes') | |
run: | | |
git checkout main | |
dfx deploy backend | |
git checkout ${GITHUB_HEAD_REF} | |
- name: Deploy current branch | |
run: dfx deploy backend | |
- name: CanisterPool test | |
run: | | |
(for f in service/pool/tests/*.test.sh; do | |
echo "==== Run test $f ====" | |
ic-repl "$f" || exit | |
done) | |
- name: Actor class test | |
run: | | |
cd ./service/pool/tests/actor_class | |
dfx canister create --all | |
dfx build | |
ic-repl ./test.sh | |
- name: Stop dfx | |
run: dfx stop |