Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit c43f0f9

Browse files
committed
Add GitHub Actions
1 parent 785489f commit c43f0f9

File tree

7 files changed

+51
-5
lines changed

7 files changed

+51
-5
lines changed

.env.schema

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ POSTGRES_HOST=localhost
22
POSTGRES_PORT=5432
33
POSTGRES_USER=postgres
44
POSTGRES_PASSWORD=password
5-
POSTGRES_DB=micropass
5+
POSTGRES_DB=vaultbox

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
services:
10+
postgres_db:
11+
image: postgres:latest
12+
env:
13+
POSTGRES_USER: postgres
14+
POSTGRES_PASSWORD: password
15+
POSTGRES_DB: vaultbox
16+
ports:
17+
- 5432:5432
18+
# needed because the postgres container does not provide a healthcheck
19+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
25+
- name: Setup JDK 17
26+
uses: actions/setup-java@v3
27+
with:
28+
distribution: 'temurin'
29+
java-version: '17'
30+
31+
- name: Generate keypair
32+
run: |
33+
openssl genrsa -out privateKey.pem 2048
34+
openssl rsa -in privateKey.pem -outform PEM -pubout -out publicKey.pem
35+
36+
- name: Run tests
37+
run: ./mvnw clean test
38+
env:
39+
POSTGRES_HOST: localhost
40+
POSTGRES_PORT: 5432
41+
POSTGRES_USER: postgres
42+
POSTGRES_PASSWORD: password
43+
POSTGRES_DB: vaultbox

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ build/
3131
### VS Code ###
3232
.vscode/
3333

34-
.env
34+
/.env
3535

36-
privateKey.pem
37-
publicKey.pem
36+
/privateKey.pem
37+
/publicKey.pem

server/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../.env

server/privateKey.pem

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../privateKey.pem

server/publicKey.pem

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../publicKey.pem

server/src/main/resources/application-development.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spring.datasource.url=jdbc:postgresql://${env.POSTGRES_HOST}:${env.POSTGRES_PORT
77
spring.datasource.username=${env.POSTGRES_USER}
88
spring.datasource.password=${env.POSTGRES_PASSWORD}
99

10-
spring.jpa.hibernate.ddl-auto = create-drop
10+
spring.jpa.hibernate.ddl-auto = create
1111

1212
jwt.publicKeyFile=publicKey.pem
1313
jwt.privateKeyFile=privateKey.pem

0 commit comments

Comments
 (0)