-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (71 loc) · 1.97 KB
/
test.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
name: Test Quasar
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
# This workflow makes x86_64 binaries for linux.
# TODO: add darwin later
jobs:
test-go:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Get git diff
uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Setup Golang
if: env.GIT_DIFF
uses: actions/setup-go@v3
with:
go-version: 1.20.7
- name: Display go version
if: env.GIT_DIFF
run: go version
- name: Run all tests
if: env.GIT_DIFF
run: make test-cover
- name: Code coverage report
if: env.GIT_DIFF
uses: codecov/codecov-action@v1.5.2
test-rust:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Get git diff
uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.rs
- name: Install Rust
if: env.GIT_DIFF
uses: dtolnay/rust-toolchain@stable
- name: Install just via cargo
run: cargo install just
- name: Download smart contracts dependencies
if: env.GIT_DIFF
run: |
cd smart-contracts
just download-deps
- name: Run unit-tests
if: env.GIT_DIFF
run: cd smart-contracts && cargo test --lib
# - name: Compile wasm code
# uses: docker://cosmwasm/rust-optimizer:0.12.6
# with:
# args: >-
# --rm -v "$(pwd)":/code
# --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target
# --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry