k8s for postgresql #80
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Java CI with Gradle | |
on: | |
push: | |
branches: [ main, development ] | |
pull_request: | |
branches: [ main, development ] | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
unit-tests: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
- name: Run test with Gradle | |
run: ./gradlew test | |
- name: Upload Unit Test Results | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Test Results | |
path: "**/build/test-results/test/**/*.xml" | |
integration-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Build the stack | |
run: docker-compose -f ./docker/docker-compose.yaml up -d | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
- name: Run tests with Gradle | |
run: ./gradlew integrationTest | |
- name: Upload Unit Test Results | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Test Results | |
path: "**/build/test-results/integrationTest/**/*.xml" | |
end-to-end-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Build the stack | |
run: docker-compose -f ./docker/docker-compose.yaml up -d | |
- name: install yarn dependencies | |
run: yarn --cwd ./client install # will run `yarn install` command | |
- name: run yarn | |
run: yarn --cwd ./client start & # will run `yarn start` command | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Build with Gradle | |
run: ./gradlew build -x test | |
- name: Run tests with Gradle | |
run: ./gradlew uiTest --tests "ru.spbstu.news.searcher.TestSuite" | |
- name: Upload ui Test Results | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Test Results | |
path: "**/build/test-results/uiTest/**/*.xml" | |
publish-unit-test-results: | |
name: "Publish Unit Tests Results" | |
needs: unit-tests | |
runs-on: macos-latest | |
# the build-and-test job might be skipped, we don't need to run this job then | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v1 | |
with: | |
files: artifacts/**/*.xml | |
publish-integration-test-results: | |
name: "Publish Integration Tests Results" | |
needs: integration-tests | |
runs-on: macos-latest | |
# the build-and-test job might be skipped, we don't need to run this job then | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Publish Integration Test Results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v1 | |
with: | |
files: artifacts/**/*.xml | |
publish-ui-test-results: | |
name: "Publish UI Tests Results" | |
needs: end-to-end-tests | |
runs-on: macos-latest | |
# the build-and-test job might be skipped, we don't need to run this job then | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Publish UI Test Results | |
uses: EnricoMi/publish-unit-test-result-action/composite@v1 | |
with: | |
files: artifacts/**/*.xml |