Skip to content

Commit

Permalink
ci: add CI flows for adex-cli (#1818)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
onur-ozkan authored May 12, 2023
1 parent 8a0cfe8 commit f8ada95
Show file tree
Hide file tree
Showing 10 changed files with 4,214 additions and 873 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ updates:
open-pull-requests-limit: 2
schedule:
# By default, Dependabot checks for new versions on Monday at a random set time for the repository
interval: weekly
interval: weekly
95 changes: 95 additions & 0 deletions .github/workflows/adex-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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/atomicDEX-API/atomicDEX-API
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: 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/atomicDEX-API/atomicDEX-API
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: 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/atomicDEX-API/atomicDEX-API
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: Start building
run: |
cargo build --manifest-path ./mm2src/adex_cli/Cargo.toml
Loading

0 comments on commit f8ada95

Please sign in to comment.