Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check with GitHub Actions #4

Merged
merged 1 commit into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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
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"

# GitHub Actions on Windows set environment variables TMP and TEMP with a legacy DOS 8.3 filename: "C:\Users\RUNNER~1\..."
# On the other hand, "embulk-input-file" expects a long filename (LFN) on Windows.
#
# The following two steps override TMP and TEMP with LFN. USERPROFILE is set with LFN fortunately.
#
# See: https://github.com/actions/virtual-environments/issues/712

- name: Override TMP to use Windows' long filename (LFN)
run: echo "TMP=$env:USERPROFILE\AppData\Local\Temp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: matrix.os == 'windows-latest'
- name: Override TEMP to use Windows' long filename (LFN)
run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: matrix.os == 'windows-latest'
- name: Check
run: ./gradlew --stacktrace check