diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 4353100..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build and test -on: push -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up OpenJDK 8 - uses: actions/setup-java@v2 - with: - java-version: 8 - distribution: "temurin" - - name: Test - env: - GCP_EMAIL: ${{secrets.GCP_EMAIL}} - GCP_JSON_KEYFILE: ${{secrets.GCP_JSON_KEYFILE}} - GCP_PRIVATE_KEYFILE: ${{secrets.GCP_PRIVATE_KEYFILE}} - GCP_BUCKET: ${{secrets.GCP_BUCKET}} - GCP_BUCKET_DIRECTORY: ${{secrets.GCP_BUCKET_DIRECTORY}} - run: ./gradlew --stacktrace test diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..4d5e789 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,33 @@ +name: Check +on: [ pull_request, push ] +jobs: + check: + runs-on: ${{ matrix.os }} + # push: always run. + # pull_request: run only when the PR is submitted from a forked repository, not within this repository. + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macOS-13 # OpenJDK 8 is not supported on macos-14+ (M1). + # - windows-latest # The tests are not ready for Windows. + steps: + - name: Set Git's core.autocrlf to false for Windows before checkout + run: git config --global core.autocrlf false + - uses: actions/checkout@v4 + - name: Set up OpenJDK 8 + uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: "temurin" + cache: "gradle" + - name: Check + env: + GCP_EMAIL: ${{secrets.GCP_EMAIL}} + GCP_JSON_KEYFILE: ${{secrets.GCP_JSON_KEYFILE}} + GCP_PRIVATE_KEYFILE: ${{secrets.GCP_PRIVATE_KEYFILE}} + GCP_BUCKET: ${{secrets.GCP_BUCKET}} + GCP_BUCKET_DIRECTORY: ${{secrets.GCP_BUCKET_DIRECTORY}} + run: ./gradlew --stacktrace check