add STRK CMC ID #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend CI | |
on: | |
pull_request: ~ | |
push: | |
branches: | |
- "main" | |
- "hotfix/**" | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" | |
required: false | |
default: false | |
env: | |
CARGO_TERM_COLOR: always | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
DATABASE_URL: postgres://postgres:postgres@localhost/marketplace_db | |
RUST_LOG: info | |
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
COINMARKETCAP_API_KEY: ${{ secrets.COINMARKETCAP_API_KEY }} | |
jobs: | |
format: | |
name: Check code formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup cargo | |
uses: ./.github/actions/cargo-setup | |
- name: Check code formatting | |
run: make fmt | |
- name: Check codecov.yml file format | |
run: curl --data-binary @- https://codecov.io/validate < codecov.yml | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup cargo | |
uses: ./.github/actions/cargo-setup | |
- name: Check application | |
run: make check | |
build: | |
name: Compile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup cargo | |
uses: ./.github/actions/cargo-setup | |
- name: Compile application | |
run: make | |
lint: | |
name: Clippy checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup cargo | |
uses: ./.github/actions/cargo-setup | |
- name: Run clippy | |
run: make clippy | |
unit_tests: | |
name: Unit tests | |
runs-on: ubuntu-latest-4-cores | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup cargo | |
uses: ./.github/actions/cargo-setup | |
- name: Run tests | |
run: make coverage/unit-tests | |
- name: Setup tmate session for debugging | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ failure() && inputs.debug_enabled }} | |
- name: Upload coverage results | |
uses: ./.github/actions/coverage-upload | |
with: | |
codecov_token: ${{ secrets.CODECOV_TOKEN }} | |
codecov_flag: unittest | |
file: lcov.info | |
api_integration_tests: | |
name: Integration tests | |
runs-on: ubuntu-latest-8-cores | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup cargo | |
uses: ./.github/actions/cargo-setup | |
- name: Run tests | |
run: make coverage/integration-tests | |
- name: Setup tmate session for debugging | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ failure() && inputs.debug_enabled }} | |
- name: Upload coverage results | |
uses: ./.github/actions/coverage-upload | |
with: | |
codecov_token: ${{ secrets.CODECOV_TOKEN }} | |
codecov_flag: integration_tests | |
file: lcov.info |