🌎 Deploy: add PR test & yml configuration at ci pipeline #7
Workflow file for this run
This file contains hidden or 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: PR Test | |
| permissions: | |
| contents: read | |
| checks: write | |
| issues: write | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| branches: [ develop, main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: temurin | |
| - name: Create application.yml | |
| run: | | |
| mkdir -p src/main/resources | |
| mkdir -p src/test/resources | |
| echo "${{ secrets.APPLICATION_YML }}" > ./src/main/resources/application.yml | |
| echo "${{ secrets.APPLICATION_YML_DEV }}" > ./src/main/resources/application-dev.yml | |
| echo "${{ secrets.APPLICATION_YML_PROD }}" > ./src/main/resources/application-prod.yml | |
| echo "${{ secrets.APPLICATION_YML_SECRET }}" > ./src/main/resources/application-secret.yml | |
| echo "${{ secrets.APPLICATION_YML_TEST }}" > ./src/test/resources/application.yml | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Test with Gradle | |
| run: ./gradlew --info test | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: ${{ always() }} | |
| with: | |
| files: build/test-results/**/*.xml |