14
14
RUST_FMT : nightly-2023-04-01
15
15
RUST_VERSION : " 1.73"
16
16
RUST_VERSION_TESTING_LIBRARY : " 1.73"
17
- CARGO_CONCORDIUM_VERSION : " 3.2 .0"
17
+ CARGO_CONCORDIUM_VERSION : " 3.3 .0"
18
18
19
19
jobs :
20
20
rustfmt :
@@ -104,6 +104,33 @@ jobs:
104
104
run : |
105
105
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --color=always
106
106
107
+ # Run unit-tests for concordium-std compiled to wasm using cargo concordium test.
108
+ std-internal-wasm-test :
109
+ name : concordium-std internal wasm tests
110
+ runs-on : ubuntu-latest
111
+
112
+ steps :
113
+ - name : Checkout sources
114
+ uses : actions/checkout@v3
115
+ with :
116
+ submodules : recursive
117
+
118
+ - name : Install toolchain
119
+ uses : actions-rs/toolchain@v1
120
+ with :
121
+ toolchain : ${{ env.RUST_VERSION }}
122
+
123
+ - name : Install Wasm target
124
+ run : rustup target install wasm32-unknown-unknown
125
+
126
+ - name : Run internal wasm unit test
127
+ working-directory : concordium-std
128
+ run : |
129
+ curl -L https://github.com/Concordium/concordium-smart-contract-tools/releases/download/releases/cargo-concordium/${CARGO_CONCORDIUM_VERSION}/cargo-concordium-linux-amd64 -o /tmp/cargo-concordium
130
+ chmod +x /tmp/cargo-concordium
131
+ sudo mv /tmp/cargo-concordium /usr/bin/cargo-concordium
132
+ cargo concordium test --only-unit-tests -- --features internal-wasm-test
133
+
107
134
# All templates are generated with the `cargo-generate` command and it is checked that the 'cargo test' command
108
135
# can be executed without errors on the generated smart contracts.
109
136
cargo-generate-templates :
@@ -146,10 +173,9 @@ jobs:
146
173
# Run all tests, including doc tests.
147
174
- name : Run cargo test
148
175
run : |
149
- CARGO_CCD=cargo-concordium_${{ env.CARGO_CONCORDIUM_VERSION }}
150
- wget https://distribution.concordium.software/tools/linux/$CARGO_CCD
151
- chmod +x $CARGO_CCD
152
- sudo mv $CARGO_CCD /usr/bin/cargo-concordium
176
+ curl -L https://github.com/Concordium/concordium-smart-contract-tools/releases/download/releases/cargo-concordium/${CARGO_CONCORDIUM_VERSION}/cargo-concordium-linux-amd64 -o /tmp/cargo-concordium
177
+ chmod +x /tmp/cargo-concordium
178
+ sudo mv /tmp/cargo-concordium /usr/bin/cargo-concordium
153
179
mv $PROJECT_NAME ${{ runner.temp }}/
154
180
cd ${{ runner.temp }}/$PROJECT_NAME
155
181
cargo concordium test --out "./concordium-out/module.wasm.v1"
@@ -196,10 +222,9 @@ jobs:
196
222
# Run all tests, including doc tests.
197
223
- name : Run cargo test
198
224
run : |
199
- CARGO_CCD=cargo-concordium_${{ env.CARGO_CONCORDIUM_VERSION }}
200
- wget https://distribution.concordium.software/tools/linux/$CARGO_CCD
201
- chmod +x $CARGO_CCD
202
- sudo mv $CARGO_CCD /usr/bin/cargo-concordium
225
+ curl -L https://github.com/Concordium/concordium-smart-contract-tools/releases/download/releases/cargo-concordium/${CARGO_CONCORDIUM_VERSION}/cargo-concordium-linux-amd64 -o /tmp/cargo-concordium
226
+ chmod +x /tmp/cargo-concordium
227
+ sudo mv /tmp/cargo-concordium /usr/bin/cargo-concordium
203
228
mv $PROJECT_NAME ${{ runner.temp }}/
204
229
cd ${{ runner.temp }}/$PROJECT_NAME
205
230
cargo concordium test --out "./concordium-out/module.wasm.v1"
@@ -563,18 +588,9 @@ jobs:
563
588
args : --manifest-path ${{ matrix.lib-crates }} --target=${{ matrix.target }} --features=${{ matrix.features }} -- -D warnings
564
589
565
590
check-std-no-std :
566
- name : Build on nightly,
591
+ name : Build no-std on nightly,
567
592
runs-on : ubuntu-latest
568
593
needs : rustfmt
569
- strategy :
570
- matrix :
571
- target :
572
- - wasm32-unknown-unknown
573
-
574
- crates :
575
- - concordium-std/Cargo.toml
576
- - concordium-cis2/Cargo.toml
577
-
578
594
steps :
579
595
- name : Checkout sources
580
596
uses : actions/checkout@v2
@@ -586,14 +602,16 @@ jobs:
586
602
with :
587
603
profile : minimal
588
604
toolchain : nightly
589
- target : ${{ matrix.target }}
605
+ target : wasm32-unknown-unknown
590
606
override : true
591
607
592
- - name : Run cargo check with no-std
593
- uses : actions-rs/cargo@v1
594
- with :
595
- command : build
596
- args : --manifest-path ${{ matrix.crates }} --target=${{ matrix.target }} --no-default-features
608
+ - name : Run no-std build concordium-std
609
+ working-directory : concordium-std
610
+ run : cargo build --target wasm32-unknown-unknown --no-default-features --features bump_alloc
611
+
612
+ - name : Run no-std build concordium-cis2
613
+ working-directory : concordium-cis2
614
+ run : cargo build --target wasm32-unknown-unknown --no-default-features --features concordium-std/bump_alloc
597
615
598
616
check-no-std-examples :
599
617
name : Build on nightly,
@@ -867,11 +885,9 @@ jobs:
867
885
868
886
- name : Download and install Cargo Concordium
869
887
run : |
870
- CARGO_CCD=cargo-concordium_${{ env.CARGO_CONCORDIUM_VERSION }}
871
- wget https://distribution.concordium.software/tools/linux/$CARGO_CCD
872
- chmod +x $CARGO_CCD
873
- sudo mv $CARGO_CCD /usr/bin/cargo-concordium
874
-
888
+ curl -L https://github.com/Concordium/concordium-smart-contract-tools/releases/download/releases/cargo-concordium/${CARGO_CONCORDIUM_VERSION}/cargo-concordium-linux-amd64 -o /tmp/cargo-concordium
889
+ chmod +x /tmp/cargo-concordium
890
+ sudo mv /tmp/cargo-concordium /usr/bin/cargo-concordium
875
891
# The 'smart-contract-upgrade' example has a v1 and v2 contract and the tests in v1 needs the wasm module from v2 for upgrading.
876
892
- name : Build contract-upgrade version 2 module if needed
877
893
if : ${{ matrix.crates == 'examples/smart-contract-upgrade/contract-version1' }}
0 commit comments