Merge pull request #534 from ThoughtWorks-SEA/dependabot/gradle/com.g… #1700
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 | |
on: | |
push: | |
branches: [master] | |
paths-ignore: ["**.md"] | |
pull_request: | |
branches: [master] | |
paths-ignore: ["**.md"] | |
create: | |
tags: | |
- '*' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Login to GitHub Container Registry | |
if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-home-cache-cleanup: true | |
- name: Gradle Build | |
run: ./gradlew build | |
- name: Save test results artifact | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-report | |
path: build/reports/tests/test | |
- name: Upload coverage to codecov.io | |
if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }} | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Gradle Local Docker Trial Build | |
if: ${{ !endsWith(github.ref, '/master') && !startsWith(github.ref, 'refs/tags/') }} | |
run: ./gradlew jibDockerBuild -x check | |
- name: Gradle Official Docker Build & Push | |
if: ${{ endsWith(github.ref, '/master') || startsWith(github.ref, 'refs/tags/') }} | |
run: ./gradlew jibGitHubContainerRegistry -x check |