forked from GLEECBTC/komodo-defi-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines-wasm-stage-job.yml
More file actions
72 lines (70 loc) · 3.02 KB
/
azure-pipelines-wasm-stage-job.yml
File metadata and controls
72 lines (70 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Job template for MM2 Build
parameters:
name: '' # defaults for any parameters that aren't specified
os: ''
bob_passphrase: ''
bob_userpass: ''
alice_passphrase: ''
alice_userpass: ''
telegram_api_key: ''
jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 0 # 0 means infinite for self-hosted agent
pool:
name: Default
demands: agent.os -equals ${{ parameters.os }}
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: ${{ eq( variables['Build.Reason'], 'Schedule' ) }} # clean up only on Scheduled build
- bash: |
if [ $CLEANUP = "true" ]
then
git clean -ffdx
fi
displayName: Clean Up
failOnStderr: false
continueOnError: true
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#set-a-job-scoped-variable-from-a-script
- bash: |
export TAG="$(git rev-parse --short=9 HEAD)"
echo "##vso[task.setvariable variable=COMMIT_HASH]${TAG}"
displayName: Setup ENV
# Build WASM.
- bash: |
rm -rf upload
mkdir upload
VERSION=$(Build.BuildId)_$(Build.SourceBranchName)_$(COMMIT_HASH)_$(Agent.OS)_Release
if ! grep -q $VERSION MM_VERSION; then
echo $VERSION > MM_VERSION
fi
cat MM_VERSION
CC=clang-8 wasm-pack build mm2src/mm2_bin_lib --release --target web --out-dir ../../target/target-wasm-release
displayName: 'Build MM2 WASM Release'
condition: ne ( variables['Build.Reason'], 'PullRequest' )
env:
MANUAL_MM_VERSION: true
- bash: |
CC=clang-8 cargo test --package mm2_main --target wasm32-unknown-unknown --release
displayName: 'Test MM2 WASM'
env:
WASM_BINDGEN_TEST_TIMEOUT: 180
GECKODRIVER: '/home/azureagent/wasm/geckodriver'
BOB_PASSPHRASE: $(${{ parameters.bob_passphrase }})
ALICE_PASSPHRASE: $(${{ parameters.alice_passphrase }})
MANUAL_MM_VERSION: true
condition: or( eq( variables['Build.Reason'], 'PullRequest' ), eq( variables['Build.SourceBranchName'], 'main' ), eq( variables['Build.SourceBranchName'], 'dev' ) )
- bash: |
cd target/target-wasm-release/
zip ../../upload/mm2-$(COMMIT_HASH)-$(Agent.OS)-Wasm-Release mm2lib_bg.wasm mm2lib.js snippets -r
displayName: 'Prepare release WASM build upload Linux'
condition: ne ( variables['Build.Reason'], 'PullRequest' )
# https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/copy-files-over-ssh?view=vsts
- task: CopyFilesOverSSH@0
inputs:
sshEndpoint: nightly_build_server
sourceFolder: 'upload' # Optional
contents: "**"
targetFolder: "uploads/$(Build.SourceBranchName)" # Optional
overwrite: true
displayName: 'Upload nightly'
condition: ne ( variables['Build.Reason'], 'PullRequest' )