Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore CI + repo cleanup #2

Merged
merged 12 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
75 changes: 0 additions & 75 deletions .env.e2e

This file was deleted.

38 changes: 38 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
###############
## Backend ##
###############

# App config
PROFILE=local

# API Keys
BACKEND_GRAPHQL_API_KEY=myapikey
GITHUB_INDEXER_API_KEY=myapikey
INFURA_API_KEY=infura_key # REPLACE_AT_INSTALLATION
COINMARKETCAP_API_KEY=coinmarketcap_key

# Logs
RUST_LOG=info

# Database
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/marketplace_db

# AMQP
AMQP_URL=amqp://127.0.0.1:5672/%2f

# Github
GITHUB_PAT=your_personal_access_token #REPLACE_AT_INSTALLATION
GITHUB_BASE_URL=https://develop-github-cache.onlydust.xyz/
GITHUB_MAX_CALLS_PER_REQUEST=500
GITHUB_EVENTS_INDEXER_SLEEP_DURATION=1
GITHUB_INDEXER_BASE_URL=http://localhost:8001/indexer

# Github configuration for Dusty bot
DUSTY_BOT_GITHUB_PAT=your_personal_access_token
DUSTY_BOT_GITHUB_MAX_CALLS_PER_REQUEST=500
DUSTY_BOT_GITHUB_BASE_URL=https://api.github.com/

# AWS
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=
2 changes: 0 additions & 2 deletions .envrc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/actions/cargo-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ runs:
steps:
- uses: Swatinem/rust-cache@v2

- name: Install toolchain
- name: Install toolchain and dependencies
shell: bash
run: rustup toolchain install 1.70 --profile minimal
run: make install
2 changes: 1 addition & 1 deletion .github/actions/env-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ runs:
steps:
- name: Run docker-compose
shell: bash
run: yarn infra:up
run: make infra/up
39 changes: 10 additions & 29 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
DATABASE_URL: postgres://postgres:postgres@localhost/marketplace_db
RUST_LOG: info
HASURA_GRAPHQL_JWT_SECRET: '{"type":"HS256","key":"5152fa850c02dc222631cca898ed1485821a70912a6e3649c49076912daa3b62182ba013315915d64f40cddfbb8b58eb5bd11ba225336a6af45bbae07ca873f3","issuer":"hasura-auth"}'
HASURA_GRAPHQL_EXPERIMENTAL_FEATURES: naming_convention
HASURA_GRAPHQL_DEFAULT_NAMING_CONVENTION: graphql-default
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 }}
Expand All @@ -37,15 +34,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
override: true
- name: Setup cargo
uses: ./.github/actions/cargo-setup

- name: Check code formatting
run: yarn backend:fmt
run: make fmt

- name: Check codecov.yml file format
run: curl --data-binary @- https://codecov.io/validate < codecov.yml
Expand All @@ -61,7 +54,7 @@ jobs:
uses: ./.github/actions/cargo-setup

- name: Check application
run: yarn backend:check
run: make check

build:
name: Compile
Expand All @@ -74,7 +67,7 @@ jobs:
uses: ./.github/actions/cargo-setup

- name: Compile application
run: yarn backend:build
run: make

lint:
name: Clippy checks
Expand All @@ -86,11 +79,8 @@ jobs:
- name: Setup cargo
uses: ./.github/actions/cargo-setup

- name: Setup clippy
run: rustup component add clippy

- name: Run clippy
run: yarn backend:clippy
run: make clippy

unit_tests:
name: Unit tests
Expand All @@ -102,14 +92,8 @@ jobs:
- name: Setup cargo
uses: ./.github/actions/cargo-setup

- name: Setup environment
uses: ./.github/actions/env-setup

- name: Install Tarpaulin
run: cargo install cargo-tarpaulin

- name: Run tests
run: yarn backend:unit-tests-with-coverage
run: make coverage/unit-tests

- name: Setup tmate session for debugging
uses: mxschmitt/action-tmate@v3
Expand All @@ -120,7 +104,7 @@ jobs:
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
codecov_flag: unittest
file: backend/cobertura.xml
file: lcov.info

api_integration_tests:
name: Integration tests
Expand All @@ -132,11 +116,8 @@ jobs:
- name: Setup cargo
uses: ./.github/actions/cargo-setup

- name: Install Tarpaulin
run: cargo install cargo-tarpaulin

- name: Run tests
run: yarn backend:integration-tests-with-coverage
run: make coverage/integration-tests

- name: Setup tmate session for debugging
uses: mxschmitt/action-tmate@v3
Expand All @@ -147,4 +128,4 @@ jobs:
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
codecov_flag: integration_tests
file: backend/cobertura.xml
file: lcov.info
43 changes: 5 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Rust

# Generated by Cargo
# will have compiled files and executables
/target/
Expand All @@ -7,25 +9,14 @@
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
#Cargo.lock


# These are backup files generated by rustfmt
**/*.rs.bk

tarpaulin_target
.rustc_info.json

*.profraw

# Protostar
**/build

# Python
# Env
.env
.env.*
!e2e/.env.e2e
!.env.develop
!.env.e2e
!.env.example
!.env.test

# MacOS
.DS_Store
Expand All @@ -39,38 +30,14 @@ _docker
# Node
node_modules
dist
dist-ssr
*.local
coverage
.nyc_output
.vite/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.vercel
*.logs

# Emacs
*~
/test-results/
/e2e/playwright/playwright-report/
/e2e/playwright/.cache/
/e2e/playwright/fixtures/__generated
/e2e/playwright/marketplace_db_dump

# Db dumps
**/*.dump

# Processes
*.pid

# Logs
*.logs

# Rust
tarpaulin_target
17 changes: 9 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"files.trimFinalNewlines": true,
"[makefile]": {
"editor.insertSpaces": false
},
"rust-analyzer.showUnlinkedFileNotification": false
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"files.trimFinalNewlines": true,
"[makefile]": {
"editor.insertSpaces": false
},
"rust-analyzer.showUnlinkedFileNotification": false
}
File renamed without changes.
File renamed without changes.
Loading