Skip to content

Commit f8ada95

Browse files
authored
ci: add CI flows for adex-cli (#1818)
* create CI flows for `adex-cli` Signed-off-by: ozkanonur <[email protected]> * format CI files Signed-off-by: ozkanonur <[email protected]> --------- Signed-off-by: ozkanonur <[email protected]> Reviewed-by: shamardy <[email protected]>
1 parent 8a0cfe8 commit f8ada95

10 files changed

+4214
-873
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ updates:
1313
open-pull-requests-limit: 2
1414
schedule:
1515
# By default, Dependabot checks for new versions on Monday at a random set time for the repository
16-
interval: weekly
16+
interval: weekly

.github/workflows/adex-cli.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: adex-cli
2+
on: [push]
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
6+
cancel-in-progress: true
7+
8+
env:
9+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
10+
11+
jobs:
12+
code-check:
13+
timeout-minutes: 60
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, macos-latest, windows-latest]
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: pre scripts for ci container
22+
run: |
23+
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
24+
echo "/bin" >> $GITHUB_PATH
25+
echo "/usr/bin" >> $GITHUB_PATH
26+
echo "/root/.cargo/bin" >> $GITHUB_PATH
27+
28+
- name: Calculate commit hash for PR commit
29+
if: github.event_name == 'pull_request'
30+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
31+
32+
- name: Calculate commit hash for merge commit
33+
if: github.event_name != 'pull_request'
34+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
35+
36+
- name: Start checking code format and lint
37+
run: |
38+
cargo fmt --manifest-path ./mm2src/adex_cli/Cargo.toml --all -- --check
39+
cargo clippy --manifest-path ./mm2src/adex_cli/Cargo.toml --all-targets --all-features -- --D warnings
40+
41+
test:
42+
timeout-minutes: 60
43+
runs-on: ${{ matrix.os }}
44+
strategy:
45+
matrix:
46+
os: [ubuntu-latest, macos-latest, windows-latest]
47+
steps:
48+
- uses: actions/checkout@v3
49+
50+
- name: pre scripts for ci container
51+
run: |
52+
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
53+
echo "/bin" >> $GITHUB_PATH
54+
echo "/usr/bin" >> $GITHUB_PATH
55+
echo "/root/.cargo/bin" >> $GITHUB_PATH
56+
57+
- name: Calculate commit hash for PR commit
58+
if: github.event_name == 'pull_request'
59+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
60+
61+
- name: Calculate commit hash for merge commit
62+
if: github.event_name != 'pull_request'
63+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
64+
65+
- name: Start testing
66+
run: |
67+
cargo test --manifest-path ./mm2src/adex_cli/Cargo.toml
68+
69+
build:
70+
timeout-minutes: 60
71+
runs-on: ${{ matrix.os }}
72+
strategy:
73+
matrix:
74+
os: [ubuntu-latest, macos-latest, windows-latest]
75+
steps:
76+
- uses: actions/checkout@v3
77+
78+
- name: pre scripts for ci container
79+
run: |
80+
git config --global --add safe.directory /__w/atomicDEX-API/atomicDEX-API
81+
echo "/bin" >> $GITHUB_PATH
82+
echo "/usr/bin" >> $GITHUB_PATH
83+
echo "/root/.cargo/bin" >> $GITHUB_PATH
84+
85+
- name: Calculate commit hash for PR commit
86+
if: github.event_name == 'pull_request'
87+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
88+
89+
- name: Calculate commit hash for merge commit
90+
if: github.event_name != 'pull_request'
91+
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
92+
93+
- name: Start building
94+
run: |
95+
cargo build --manifest-path ./mm2src/adex_cli/Cargo.toml

0 commit comments

Comments
 (0)