forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 94
104 lines (84 loc) · 3.48 KB
/
adex-cli.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
name: adex-cli
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
code-check:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
- name: Calculate commit hash for merge commit
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Start checking code format and lint
run: |
cargo fmt --manifest-path ./mm2src/adex_cli/Cargo.toml --all -- --check
cargo clippy --manifest-path ./mm2src/adex_cli/Cargo.toml --all-targets --all-features -- --D warnings
test:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
- name: Calculate commit hash for merge commit
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Start testing
run: |
cargo test --manifest-path ./mm2src/adex_cli/Cargo.toml
build:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: pre scripts for ci container
run: |
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
echo "/bin" >> $GITHUB_PATH
echo "/usr/bin" >> $GITHUB_PATH
echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Calculate commit hash for PR commit
if: github.event_name == 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
- name: Calculate commit hash for merge commit
if: github.event_name != 'pull_request'
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
- name: Cargo cache
uses: ./.github/actions/cargo-cache
- name: Start building
run: |
cargo build --manifest-path ./mm2src/adex_cli/Cargo.toml