Skip to content

Commit 10c0a3f

Browse files
authored
Merge pull request #4 from embulk/enable-tests-for-Windows-with-github-actions
Enable tests for Windows with GitHub Actions
2 parents 73f72a6 + bb2edd1 commit 10c0a3f

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/check.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
os:
1010
- ubuntu-latest
1111
- macOS-latest
12-
# - windows-latest
12+
- windows-latest
1313
gradle_task:
1414
- ":embulk-decoder-bzip2:check"
1515
- ":embulk-decoder-gzip:check"
@@ -31,11 +31,28 @@ jobs:
3131
- ":embulk-parser-csv:check"
3232
- ":embulk-parser-json:check"
3333
steps:
34+
- name: Set Git's core.autocrlf to false for Windows before checkout
35+
run: git config --global core.autocrlf false
3436
- uses: actions/checkout@v2
3537
- name: Set up OpenJDK 8
3638
uses: actions/setup-java@v2
3739
with:
3840
java-version: 8
3941
distribution: "zulu"
42+
43+
# GitHub Actions on Windows set environment variables TMP and TEMP with a legacy DOS 8.3 filename: "C:\Users\RUNNER~1\..."
44+
# On the other hand, "embulk-input-file" expects a long filename (LFN) on Windows.
45+
#
46+
# The following two steps override TMP and TEMP with LFN. USERPROFILE is set with LFN fortunately.
47+
#
48+
# See: https://github.com/actions/virtual-environments/issues/712
49+
50+
- name: Override TMP to use Windows' long filename (LFN)
51+
run: echo "TMP=$env:USERPROFILE\AppData\Local\Temp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
52+
if: matrix.os == 'windows-latest'
53+
- name: Override TEMP to use Windows' long filename (LFN)
54+
run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
55+
if: matrix.os == 'windows-latest'
56+
4057
- name: Build and test
4158
run: ./gradlew ${{ matrix.gradle_task }}

0 commit comments

Comments
 (0)