-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
137 lines (131 loc) · 4.83 KB
/
azure-pipelines.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
trigger:
- master
- refs/tags/*
variables:
RUST_STABLE: nightly-2021-09-12
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 0
steps:
- script: git submodule update --init --recursive
displayName: 'Submodules'
- script: |
curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
source ~/.cargo/env
rustup update $(RUST_STABLE)
rustup target add wasm32-unknown-unknown --toolchain $(RUST_STABLE)
displayName: 'Rust setup'
- script: |
source ~/.cargo/env
RANDOMX_ARCH=default RUSTUP_TOOLCHAIN=$(RUST_STABLE) WASM_BUILD_TOOLCHAIN=$(RUST_STABLE) RUSTC_BOOTSTRAP=1 cargo test --release --all --locked
displayName: 'Run tests'
- script: |
source ~/.cargo/env
RANDOMX_ARCH=default RUSTUP_TOOLCHAIN=$(RUST_STABLE) WASM_BUILD_TOOLCHAIN=$(RUST_STABLE) RUSTC_BOOTSTRAP=1 cargo build --release --locked
displayName: 'Build artifacts'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'target/release/kulupu'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/kulupu-linux.zip'
displayName: 'Archive artifacts'
- script: |
shasum -a 256 $(Build.ArtifactStagingDirectory)/kulupu-linux.zip > $(Build.ArtifactStagingDirectory)/kulupu-linux.zip.sha256
displayName: 'Finalize artifacts'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
- job: Lint
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 0
steps:
- script: git submodule update --init --recursive
displayName: 'Submodules'
- script: |
curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
source ~/.cargo/env
rustup update $(RUST_STABLE)
rustup target add wasm32-unknown-unknown --toolchain $(RUST_STABLE)
displayName: 'Rust setup'
- script: |
source ~/.cargo/env
RANDOMX_ARCH=default RUSTUP_TOOLCHAIN=$(RUST_STABLE) WASM_BUILD_TOOLCHAIN=$(RUST_STABLE) RUSTC_BOOTSTRAP=1 cargo fmt --all -- --check
displayName: 'Check rustfmt'
- job: WebAssembly
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 0
steps:
- script: git submodule update --init --recursive
displayName: 'Submodules'
- script: docker build --tag kulupu-wasm-build:ci --no-cache --pull .
displayName: 'Build docker'
- script: |
docker run --volume=$(Build.ArtifactStagingDirectory):/wasm kulupu-wasm-build:ci export-builtin-wasm /wasm
displayName: 'Generate wasm'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
- job: MacOS
pool:
vmImage: 'macOS-latest'
timeoutInMinutes: 0
steps:
- script: git submodule update --init --recursive
displayName: 'Submodules'
- script: |
curl -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
source ~/.cargo/env
rustup update $(RUST_STABLE)
rustup target add wasm32-unknown-unknown --toolchain $(RUST_STABLE)
displayName: 'Rust setup'
- script: |
source ~/.cargo/env
RANDOMX_ARCH=default RUSTUP_TOOLCHAIN=$(RUST_STABLE) WASM_BUILD_TOOLCHAIN=$(RUST_STABLE) RUSTC_BOOTSTRAP=1 cargo build --release --locked
displayName: 'Build artifacts'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'target/release/kulupu'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/kulupu-macos.zip'
displayName: 'Archive artifacts'
- script: |
shasum -a 256 $(Build.ArtifactStagingDirectory)/kulupu-macos.zip > $(Build.ArtifactStagingDirectory)/kulupu-macos.zip.sha256
displayName: 'Finalize artifacts'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
- job: Windows
condition: false
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 0
steps:
- script: git submodule update --init --recursive
displayName: 'Submodules'
- script: |
rustup update --no-self-update $(RUST_STABLE)
rustup target add wasm32-unknown-unknown --toolchain $(RUST_STABLE)
displayName: 'Rust setup'
- script: |
set LIBCLANG_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\Llvm\x64\bin
set RANDOMX_ARCH=default
set RUSTUP_TOOLCHAIN=$(RUST_STABLE)
set WASM_BUILD_TOOLCHAIN=$(RUST_STABLE)
set RUSTC_BOOTSTRAP=1
cargo build --release --locked
displayName: 'Build artifacts'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: 'target/release/kulupu.exe'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/kulupu-windows.zip'
displayName: 'Archive artifacts'
- script: |
CertUtil -hashfile $(Build.ArtifactStagingDirectory)/kulupu-windows.zip SHA256 > $(Build.ArtifactStagingDirectory)/kulupu-windows.zip.sha256
displayName: 'Finalize artifacts'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'