From d74b8a37b86c01c65b7fcbcd089cb8ab4025be3b Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Thu, 16 May 2024 22:43:10 +0900 Subject: [PATCH] chore: ci: add github actions check --- .github/FUNDING.yml | 1 + .github/workflows/gradle-build-master.yml | 41 +++++++++++++++++++++++ .github/workflows/spotbugs-annotate.yml | 24 +++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/gradle-build-master.yml create mode 100644 .github/workflows/spotbugs-annotate.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..c52584b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=thank.you.omegat%40gmail.com&item_name=Donation+to+OmegaT+-+multiplatform+CAT+tool¤cy_code=USD&source=url diff --git a/.github/workflows/gradle-build-master.yml b/.github/workflows/gradle-build-master.yml new file mode 100644 index 0000000..dd986b7 --- /dev/null +++ b/.github/workflows/gradle-build-master.yml @@ -0,0 +1,41 @@ +name: Unit Tests, Quality checks, and Acceptance Tests + +on: + push: + branches: + - master + - releases/* + pull_request: + +jobs: + gradle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: 'temurin' + - uses: gradle/wrapper-validation-action@v3 + name: validate gradle wrapper + - uses: gradle/actions/setup-gradle@v3 + name: Setup Gradle + id: setup-gradle + - name: Run gradle build + run: ./gradlew --scan build + id: gradle + - name: "Add Build Scan URL as PR comment" + uses: actions/github-script@v7 + if: github.event_name == 'pull_request' && failure() + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `❌ ${{ github.workflow }} **failed**. + + Please look a Gradle Scan page for details: + ${{ steps.gradle.outputs.build-scan-url }}` + }) diff --git a/.github/workflows/spotbugs-annotate.yml b/.github/workflows/spotbugs-annotate.yml new file mode 100644 index 0000000..befd198 --- /dev/null +++ b/.github/workflows/spotbugs-annotate.yml @@ -0,0 +1,24 @@ +name: Run SpotBugs + +on: + push: + branches: + - master + - releases/* + pull_request: + +jobs: + spotbugs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '11' + - name: create annotation + run: echo "::add-matcher::${{ github.workspace }}/ci/github/problem-matcher.json" + - name: run spotbugs + uses: gradle/actions/setup-gradle@v3 + with: + arguments: --continue spotbugsMain