Skip to content

Configure OAuth2 authorization #65

Configure OAuth2 authorization

Configure OAuth2 authorization #65

Workflow file for this run

name: Build
on:
push:
branches:
- master
- feature/**
- dependabot/**
path:
- .github/**
- src/**
- tests/**
- docker-compose.yml
- common-service/**
- gateway-service/**
- store-service/**
- warehouse-service/**
- warranty-service/**
- build.gradle
- gradle.properties
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "21"
cache: "gradle"
- name: Validate styles
uses: pre-commit/action@v3.0.0
- name: Build project
run: ./gradlew clean build
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: jar
path: "*/build/libs/*.jar"
retention-days: 1
test:
name: Integration Test
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/download-artifact@v4
with:
name: jar
path: .
- name: Build images
timeout-minutes: 5
run: docker compose build
- name: Run containers
id: run-containers
timeout-minutes: 10
run: |
docker compose up -d --wait
env:
OAUTH2_SECURITY_ENABLED: true
- name: Print logs
if: ${{ failure() && steps.run-containers.outcome != 'success' }}
run: |
docker compose logs
- name: Run API Tests
uses: matt-ball/newman-action@master
with:
collection: tests/postman/collection.json
environment: tests/postman/local-auth0.json
delayRequest: 100
reporters: '["cli"]'
- name: Stop containers
if: ${{ always() }}
continue-on-error: true
run: docker compose down -v