Skip to content

Commit

Permalink
Merge pull request #42 from SakaDream/add-testcontainers-and-refactor…
Browse files Browse the repository at this point in the history
…ing-code

Add testcontainers and refactoring code
  • Loading branch information
SakaDream committed Jun 29, 2023
2 parents 25ddfad + 3447d3a commit b0e1446
Show file tree
Hide file tree
Showing 46 changed files with 1,837 additions and 769 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/ci_action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
cicd-linux:
Expand All @@ -19,7 +19,12 @@ jobs:
shell: sh
run: |
mv src/secret.key.sample src/secret.key
- name: Import sample dotenv file
shell: sh
run: |
mv dotenv.sample .env
- name: Cache cargo registry
uses: actions/cache@v1
with:
Expand Down Expand Up @@ -95,6 +100,10 @@ jobs:
shell: cmd
run: ren src\secret.key.sample secret.key

- name: Import sample dotenv file
shell: cmd
run: ren dotenv.sample .env

- name: Cache cargo registry
uses: actions/cache@v1
with:
Expand All @@ -112,7 +121,7 @@ jobs:
restore-keys: |
${{ runner.os }}-index-
${{ runner.os }}-
- name: Cache cargo build
uses: actions/cache@v1
with:
Expand Down Expand Up @@ -146,6 +155,7 @@ jobs:

- name: Run cargo test
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: test
args: -- --nocapture
Expand Down Expand Up @@ -176,7 +186,12 @@ jobs:
shell: sh
run: |
mv src/secret.key.sample src/secret.key
- name: Import sample dotenv file
shell: sh
run: |
mv dotenv.sample .env
- name: Cache cargo registry
uses: actions/cache@v1
with:
Expand All @@ -194,7 +209,7 @@ jobs:
restore-keys: |
${{ runner.os }}-index-
${{ runner.os }}-
- name: Cache cargo build
uses: actions/cache@v1
with:
Expand Down Expand Up @@ -226,6 +241,7 @@ jobs:

- name: Run cargo test
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: test
args: -- --nocapture
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/docker_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
cicd-linux-docker:
Expand Down Expand Up @@ -111,7 +108,7 @@ jobs:
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
Expand Down
128 changes: 118 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,98 @@
# Created by https://www.toptal.com/developers/gitignore/api/rust,visualstudiocode,intellij+iml
# Edit at https://www.toptal.com/developers/gitignore?templates=rust,visualstudiocode,intellij+iml

# Created by https://www.gitignore.io/api/rust,code
# Edit at https://www.gitignore.io/?templates=rust,code
### Intellij+iml ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

### Code ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+iml Patch ###
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

### Rust ###
# Generated by Cargo
# will have compiled files and executables
/target/
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand All @@ -21,9 +101,37 @@ Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# Support for Project snippet scope
.vscode/*.code-snippets

# Ignore code-workspaces
*.code-workspace

# Extras
.env
/src/secret.key
/act/

# End of https://www.gitignore.io/api/rust,code
# End of https://www.toptal.com/developers/gitignore/api/rust,visualstudiocode,intellij+iml
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 42 additions & 42 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'actix-web-rest-api-with-jwt'",
"cargo": {
"args": [
"build",
"--bin=actix-web-rest-api-with-jwt",
"--package=actix-web-rest-api-with-jwt"
],
"filter": {
"name": "actix-web-rest-api-with-jwt",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'actix-web-rest-api-with-jwt'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=actix-web-rest-api-with-jwt",
"--package=actix-web-rest-api-with-jwt"
],
"filter": {
"name": "actix-web-rest-api-with-jwt",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'actix-web-rest-api-with-jwt'",
"cargo": {
"args": [
"build",
"--bin=actix-web-rest-api-with-jwt",
"--package=actix-web-rest-api-with-jwt"
],
"filter": {
"name": "actix-web-rest-api-with-jwt",
"kind": "bin"
}
]
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'actix-web-rest-api-with-jwt'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=actix-web-rest-api-with-jwt",
"--package=actix-web-rest-api-with-jwt"
],
"filter": {
"name": "actix-web-rest-api-with-jwt",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
Loading

0 comments on commit b0e1446

Please sign in to comment.