From f3a52b28240f914b4da5f9904ca4b4a80a0bdcb6 Mon Sep 17 00:00:00 2001 From: Yoshikazu Nojima Date: Tue, 20 May 2025 21:44:53 +0900 Subject: [PATCH] Add CI workflows --- .github/dependabot.yml | 12 ++++++ .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++ .github/workflows/pr-gate-ci.yml | 67 ++++++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/pr-gate-ci.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..afe8855 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: gradle + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7bc8f35 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +on: + push: + tags: + - '*' + branches: + - '*' + schedule: + # everyday 10AM (UTC) + - cron: '0 10 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + java_version: [17] + os: [windows-latest] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java_version }} + cache: 'gradle' + + - name: Build with Gradle + run: ./gradlew build javadoc asciidoc + + matrix-test: + name: Test on java ${{ matrix.java_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + java_version: [17] + os: [windows-latest] # , macOS-latest (remove macOS as it is not stable for now) , ubuntu-latest (remove Ubuntu as Chrome 77 doesn't work + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java_version }} + cache: 'gradle' + + - name: Build with Gradle + run: ./gradlew check diff --git a/.github/workflows/pr-gate-ci.yml b/.github/workflows/pr-gate-ci.yml new file mode 100644 index 0000000..bee6e7e --- /dev/null +++ b/.github/workflows/pr-gate-ci.yml @@ -0,0 +1,67 @@ +name: Pull Request Gate CI + +on: pull_request + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + java_version: [17] + os: [windows-latest] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java_version }} + cache: 'gradle' + + - name: Build with Gradle + run: ./gradlew build javadoc asciidoc + + matrix-test: + name: Test on java ${{ matrix.java_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + java_version: [17] + os: [windows-latest] # , macOS-latest (remove macOS as it is not stable for now) + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java_version }} + cache: 'gradle' + + - name: Build with Gradle + run: ./gradlew check + + auto-merge: + name: Auto Merge + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + permissions: + contents: write + pull-requests: write + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Merge + run: gh pr merge "${GITHUB_HEAD_REF}" --merge --auto