Users api #134
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Server CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build_test_server: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: ivy_learn | |
ports: | |
- 5432:5432 | |
env: | |
IVY_LEARN_DB_HOST: localhost | |
IVY_LEARN_DB_DATABASE: ivy_learn | |
IVY_LEARN_DB_USER: postgres | |
IVY_LEARN_DB_PORT: 5432 | |
IVY_LEARN_DB_PASSWORD: password | |
IVY_LEARN_GITHUB_PAT: ${{ secrets.IVY_LEARN_GITHUB_PAT }} | |
IVY_GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.IVY_GOOGLE_OAUTH_CLIENT_ID }} | |
IVY_GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.IVY_GOOGLE_OAUTH_CLIENT_SECRET }} | |
steps: | |
- name: Checkout GIT | |
uses: actions/checkout@v4 | |
- name: Setup Java SDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '18' | |
- name: Enable Gradle Wrapper caching (optimization) | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Build Server | |
run: ./gradlew stage | |
- name: Start Server | |
run: | | |
chmod +x ./server/build/install/server/bin/server | |
./server/build/install/server/bin/server & | |
sleep 5 | |
- name: Wait for the server to get ready | |
run: | | |
while ! nc -z localhost 8081; do sleep 1; done | |
- name: Run unit tests | |
run: ./gradlew server:test |