Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Cupnfish committed Apr 6, 2024
0 parents commit a7d244a
Show file tree
Hide file tree
Showing 40 changed files with 8,925 additions and 0 deletions.
1 change: 1 addition & 0 deletions .cargo-ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":1}
6 changes: 6 additions & 0 deletions .cargo_vcs_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"git": {
"sha1": "19dd183b1778a6e3e034f23f600ffe54f3d8e8f1"
},
"path_in_vcs": ""
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.anchor
.DS_Store
target
**/*.rs.bk
node_modules
68 changes: 68 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.test_cache: &test_cache
cache:
- key: "$CI_COMMIT_REF_SLUG"
paths:
- target/debug

.rust_build: &rust_build
image: "ars9/rust:postgres"
before_script:
- rustc --version
- cargo --version

services:
- postgres:15-alpine

variables:
POSTGRES_HOST: postgres
POSTGRES_DB: indexer
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}
CARGO_HOME: "/cache/cargo/"

stages:
- test
- build
- deploy

test-code:
<<: *rust_build
<<: *test_cache
stage: test
before_script:
- "sed -i 's/host: \"localhost\"/host: \"postgres\"/' configuration.yaml"
script:
- cargo test
- cargo tarpaulin --ignore-tests

lint-code:
<<: *rust_build
<<: *test_cache
stage: test
script:
- cargo clippy -- -D warnings

format-code:
<<: *rust_build
<<: *test_cache
stage: test
script:
- cargo fmt -- --check

## Temporarily disabled due to ansi_term vulnerability
# audit-code:
# <<: *rust_build
# <<: *test_cache
# stage: test
# script:
# - cargo audit

publish:
<<: *rust_build
stage: build
script:
- cargo publish
only:
- tags
Loading

0 comments on commit a7d244a

Please sign in to comment.