-
Notifications
You must be signed in to change notification settings - Fork 29
98 lines (98 loc) · 3.09 KB
/
Features.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
name: Features
on:
push:
branches:
- feature/*
pull_request:
branches:
- feature/*
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
platform: [scalable]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
#- name: check fmt
# shell: bash
# run: |
# cargo fmt -- --check
# - name: test_status
# env:
# DBG: true
# shell: bash
# run: |
# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# make test_status
## It need to install protobuf-compiler for build environment.
## Enable this when build by container.
# - name: Install protobuf-compiler
# shell: bash
# run: |
# apt install protobuf-compiler
- name: install rustwasm
shell: bash
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: add go
shell: bash
run: |
mkdir $(pwd)/opt && cd $(pwd)/opt && wget https://golang.google.cn/dl/go1.15.7.linux-amd64.tar.gz && tar -xpf go1.15.7.linux-amd64.tar.gz && echo "$(pwd)/go/bin" >> $GITHUB_PATH
- name: go test
shell: bash
run: |
echo "${GITHUB_PATH}"
echo "${PATH}"
go version
- name: lint
shell: bash
run: |
make lint
# - name: Push wasm-js-bindings
# shell: bash
# run: |
# if echo "${GITHUB_REF}" | grep "refs/pull" >/dev/null; then
# export PR=$(echo ${GITHUB_REF} | cut -d "/" -f 3)
# export BRANCH="${GITHUB_HEAD_REF}"
# export TOBRANCH="${GITHUB_BASE_REF}"
# else
# export BRANCH=$(echo ${GITHUB_REF} | sed "s#refs/heads/##g")
# fi
# export BRANCH_NAME="test-ci"
# export WASM_DIR="/tmp/wasm-js-bindings"
# if [ ! -d "${WASM_DIR}" ]; then git clone git@github.com:FindoraNetwork/wasm-js-bindings.git "${WASM_DIR}"; fi
# pushd "${WASM_DIR}"
# git checkout "${BRANCH_NAME}" || git checkout -b "${BRANCH_NAME}"
# git pull origin "${BRANCH_NAME}" || true
# if [ ! -d "${WASM_DIR}/nodejs" ]; then mkdir "${WASM_DIR}/nodejs"; fi
# if [ ! -d "${WASM_DIR}/web" ]; then mkdir "${WASM_DIR}/web"; fi
# popd
# pushd src/components/wasm
# wasm-pack build --target nodejs --out-dir "${WASM_DIR}/nodejs"
# rm "${WASM_DIR}/nodejs/.gitignore"
# wasm-pack build --target web --out-dir "${WASM_DIR}/web"
# rm "${WASM_DIR}/web/.gitignore"
# popd
# pushd "${WASM_DIR}"
# if [ "$(git diff)" != "" ]; then
# git add .
# git commit -m "From platform PR ${PR}(${BRANCH} to ${TOBRANCH}), build date: $(date +"%Y%m%d")"
# git push -f origin "${BRANCH_NAME}"
# fi
# popd
- name: test
shell: bash
run: |
make test
- name: Clean garbage
shell: bash
run: |
rm -rf /tmp/*>/dev/null 2>&1 || true