-
Notifications
You must be signed in to change notification settings - Fork 172
/
Copy pathappveyor.yml
71 lines (64 loc) · 2.49 KB
/
appveyor.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
# This CI configuration tests the cw-template repository itself,
# not the resulting project. We want to ensure that
# 1. the template to project generation works
# 2. the template files are up to date
#
# We chose Appveyor for this task as it allows us to use an arbitrary config
# location. Furthermore it allows us to ship Circle CI and GitHub Actions configs
# generated for the resulting project.
image: Ubuntu
environment:
TOOLCHAIN: 1.82.0
CARGO_GENERATE_VERSION: 0.22.1
# services:
# - docker
cache:
- $HOME/.rustup/ -> meta/appveyor.yml
# For details about cargo caching see https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
- $HOME/.cargo/bin/ -> meta/appveyor.yml
- $HOME/.cargo/registry/index/ -> meta/appveyor.yml
- $HOME/.cargo/registry/cache/ -> meta/appveyor.yml
- $HOME/.cargo/git/db/ -> meta/appveyor.yml
install:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain "$TOOLCHAIN" -y
- source $HOME/.cargo/env
- rustc --version
- cargo --version
- rustup target add wasm32-unknown-unknown
# Use || true because this fails when already installed from cache
- cargo install --features vendored-openssl cargo-generate --locked --version "$CARGO_GENERATE_VERSION" --debug || true
build_script:
# No matter what is currently checked out by the CI (main, other branch, PR merge commit),
# we create a temporary local branch from that point with a constant name, which we need for
# cargo generate.
- git branch current-ci-checkout
- cd ..
# Generate minimal
- cargo generate --git cw-template --name testgen-ci --branch current-ci-checkout -d minimal=true
- cd testgen-ci
- ls -lA
- cargo fmt -- --check
- cargo unit-test
- cargo wasm
- cargo schema
# Cleanup
- cd ..
- rm -r testgen-ci
# Generate full
- cargo generate --git cw-template --name testgen-ci --branch current-ci-checkout -d minimal=false
- cd testgen-ci
- ls -lA
- cargo fmt -- --check
- cargo unit-test
- cargo wasm
- cargo schema
# - docker build --pull -t "cosmwasm/cw-gitpod-base:${APPVEYOR_REPO_COMMIT}" .
# - \[ "${APPVEYOR_REPO_BRANCH}" = "main" \] && image_tag=latest || image_tag=${APPVEYOR_REPO_TAG_NAME}
# - docker tag "cosmwasm/cw-gitpod-base:${APPVEYOR_REPO_COMMIT}" "cosmwasm/cw-gitpod-base:${image_tag}"
# Publish cosmwasm/cw-gitpod-base
#
# on_success:
# # publish docker image
# - docker login --password-stdin -u "$DOCKER_USER" <<<"$DOCKER_PASS"
# - docker push
# - docker logout