update dependencies #153
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: Build project | ||
on: [ push ] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "corretto" | ||
java-version: "17" | ||
cache: "gradle" | ||
- name: Validate styles | ||
uses: pre-commit/[email protected] | ||
- name: Build project | ||
uses: eskatos/gradle-command-action@v2 | ||
with: | ||
arguments: clean build | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: jar | ||
path: "*-service/build/libs/*.jar" | ||
retention-days: 1 | ||
test: | ||
name: Integration Test | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: actions/download-artifact@v3 | ||
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 | ||
- name: Print logs | ||
if: ${{ failure() && steps.run-containers.outcome != "success" }} | ||
Check failure on line 56 in .github/workflows/main.yml GitHub Actions / Build projectInvalid workflow file
|
||
run: | | ||
docker compose logs | ||
- name: Run API Tests | ||
uses: matt-ball/newman-action@master | ||
with: | ||
collection: tests/postman/collection.json | ||
environment: tests/postman/local-environment.json | ||
delayRequest: 100 | ||
reporters: '["cli"]' | ||
- name: Stop containers | ||
if: ${{ always() }} | ||
continue-on-error: true | ||
run: docker compose down -v | ||
publish: | ||
name: Publish to Docker Hub | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: jar | ||
path: . | ||
- name: Build images | ||
timeout-minutes: 5 | ||
run: docker compose build | ||
- name: Push images | ||
run: docker compose push |