Adds Tests to Github Actions
This commit is contained in:
39
.github/workflows/docker-image.yml
vendored
39
.github/workflows/docker-image.yml
vendored
@@ -6,46 +6,11 @@ on:
|
|||||||
- 'main'
|
- 'main'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgres:11
|
|
||||||
env:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
POSTGRES_DB: portfolio
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Set up JDK 11
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
java-version: '11'
|
|
||||||
distribution: 'temurin'
|
|
||||||
cache: maven
|
|
||||||
|
|
||||||
- name: Build with Maven
|
|
||||||
env:
|
|
||||||
FRONT_END_PATH: 'localhost:5000'
|
|
||||||
FRONT_END_CONNECTION_TYPE: 'unsecure'
|
|
||||||
PORT: 8070
|
|
||||||
DATABASE_URL: 'postgresql://localhost:5432/portfolio'
|
|
||||||
DATABASE_USER: 'postgres'
|
|
||||||
DATABASE_PASSWORD: 'postgres'
|
|
||||||
run: ./mvnw -B package --file pom.xml
|
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
|
|
||||||
|
needs: run-tests
|
||||||
needs: [build]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
|||||||
20
.github/workflows/run-tests.yml
vendored
Normal file
20
.github/workflows/run-tests.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: ci
|
||||||
|
on:
|
||||||
|
push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: maven
|
||||||
|
|
||||||
|
- name: Running Tests with Maven
|
||||||
|
run: ./mvnw test
|
||||||
Reference in New Issue
Block a user