Skip to content

Commit b7fa3a5

Browse files
committed
.github/workflows: upgrade to ruby/setup-ruby@v1
As the actions/setup-ruby GitHub Action is deprecated in favour of the ruby/setup-ruby Action, we upgrade to use the latter in our CI and release workflows. In the Windows builds, the ruby/setup-ruby@v1 Action installs the MSYS2 build tools and sets some environment variables which persist for subsequent steps in the workflow, such as the TMPDIR variable. These differences from the actions/setup-ruby Action introduce failures into our test suite, principally by causing Actions to run the Bash shell in C:\msys64\usr\bin instead of the one in C:\Program Files\Git\bin, which in turn results in the "git" command running the git.exe binary found in C:\Program Files\Git\bin instead of C:\Program Files\Git\mingw64\bin. The Git binary in C:\Program Files\Git\bin, when asked to run a "git lfs" command, then finds the git-lfs.exe binary in C:\Program Files\Git\cmd instead of the one we have built, despite our changing the PATH environment variable so that our built git-lfs.exe binary should be found first. We resolve this problem by renaming the C:\msys64 directory with a temporary name after installing the asciidoctor Ruby gem. Also note that we do not need to specify the Bash shell to run the "gem install acsiidoctor" step, and that we move this step below the ruby/setup-ruby@v1 step in all cases so as to make the dependency more clear. (We also move the "gem install packagecloud-ruby" step into the same relative location, for the same reason.) The ruby/setup-ruby@v1 Action also sets the TMPDIR environment variable for all subsequent steps, and this results in other test suite failures on Windows because we create paths for our temporary test repositories in our GIT_LFS_TEST_DIR path, which we set using mktemp(1), and that derives its defaut path from TMPDIR. However, some of our test helper programs such as lfstest-customadapter use the Go language ioutil.TempFile() function to construct paths, which calls os.TempDir(), and on Windows that does not refer to the TMPDIR environment variable but the TMP and TEMP ones instead. The consequence is that tests using those helper programs try to move files between directories creating using both techniques of temporary path creation, and these return paths on different volumes, so the test fails when trying to move files between D:\a\_temp and C:\Users\RUNNER~1\AppData\Local\Temp. Therefore we take care to unset the TMPDIR variable before running commands which might make use of mktemp(1). h/t MSP-Greg for the suggestion to rename C:\msys64
1 parent 4140f63 commit b7fa3a5

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
steps:
1313
- uses: actions/checkout@v1
14-
- uses: actions/setup-ruby@v1
14+
- uses: ruby/setup-ruby@v1
15+
- run: gem install asciidoctor
1516
- uses: actions/setup-go@v2
1617
with:
1718
go-version: ${{ matrix.go }}
@@ -21,7 +22,6 @@ jobs:
2122
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
2223
env:
2324
DEBIAN_FRONTEND: noninteractive
24-
- run: gem install asciidoctor
2525
- run: script/cibuild
2626
env:
2727
FORCE_LOCALIZE: true
@@ -51,7 +51,9 @@ jobs:
5151
runs-on: windows-latest
5252
steps:
5353
- uses: actions/checkout@v1
54-
- uses: actions/setup-ruby@v1
54+
- uses: ruby/setup-ruby@v1
55+
- run: gem install asciidoctor
56+
- run: Rename-Item -Path C:\msys64 -NewName msys64-tmp -Force
5557
- uses: actions/setup-go@v2
5658
with:
5759
go-version: '1.19.x'
@@ -61,13 +63,11 @@ jobs:
6163
- run: cinst InnoSetup -y
6264
- run: cinst strawberryperl -y
6365
- run: refreshenv
64-
- run: gem install asciidoctor
65-
shell: bash
6666
- run: make man
6767
shell: bash
6868
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
6969
shell: bash
70-
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" script/cibuild
70+
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" env -u TMPDIR script/cibuild
7171
shell: bash
7272
- run: rm -f commands/mancontent_gen.go
7373
shell: bash
@@ -126,7 +126,7 @@ jobs:
126126
runs-on: ubuntu-20.04
127127
steps:
128128
- uses: actions/checkout@v1
129-
- uses: actions/setup-ruby@v1
129+
- uses: ruby/setup-ruby@v1
130130
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
131131
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh)
132132
- run: ./docker/run_dockers.bsh --prune
@@ -139,7 +139,7 @@ jobs:
139139
container: [debian_11]
140140
steps:
141141
- uses: actions/checkout@v1
142-
- uses: actions/setup-ruby@v1
142+
- uses: ruby/setup-ruby@v1
143143
- run: |
144144
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
145145
sudo systemctl restart docker.service

.github/workflows/release.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ jobs:
1212
go: ['1.19.x']
1313
steps:
1414
- uses: actions/checkout@v1
15-
- uses: actions/setup-ruby@v1
15+
- uses: ruby/setup-ruby@v1
16+
- run: gem install asciidoctor
17+
- run: Rename-Item -Path C:\msys64 -NewName msys64-tmp -Force
1618
- uses: actions/setup-go@v2
1719
with:
1820
go-version: ${{ matrix.go }}
@@ -23,34 +25,33 @@ jobs:
2325
- run: cinst strawberryperl -y
2426
- run: cinst zip -y
2527
- run: cinst jq -y
26-
- run: gem install asciidoctor
2728
- run: refreshenv
2829
- run: GOPATH="$HOME/go" PATH="$HOME/go/bin:$PATH" go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
2930
shell: bash
3031
- run: mkdir -p bin/releases
3132
shell: bash
32-
- run: CERT_FILE="$HOME/cert.pfx" make release-write-certificate
33+
- run: CERT_FILE="$HOME/cert.pfx" env -u TMPDIR make release-write-certificate
3334
shell: bash
3435
env:
3536
CERT_CONTENTS: ${{secrets.WINDOWS_CERT_BASE64}}
36-
- run: PATH="$HOME/go/bin:$PATH" GOARCH=amd64 go generate && make bin/releases/git-lfs-windows-amd64-$(git describe).zip
37+
- run: PATH="$HOME/go/bin:$PATH" GOARCH=amd64 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-amd64-$(git describe).zip
3738
shell: bash
3839
env:
3940
FORCE_LOCALIZE: true
40-
- run: PATH="$HOME/go/bin:$PATH" GOARCH=386 go generate && make bin/releases/git-lfs-windows-386-$(git describe).zip
41+
- run: PATH="$HOME/go/bin:$PATH" GOARCH=386 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-386-$(git describe).zip
4142
shell: bash
4243
env:
4344
FORCE_LOCALIZE: true
44-
- run: PATH="$HOME/go/bin:$PATH" GOARCH=arm64 go generate && make bin/releases/git-lfs-windows-arm64-$(git describe).zip
45+
- run: PATH="$HOME/go/bin:$PATH" GOARCH=arm64 go generate && env -u TMPDIR make bin/releases/git-lfs-windows-arm64-$(git describe).zip
4546
shell: bash
4647
env:
4748
FORCE_LOCALIZE: true
48-
- run: PATH="$HOME/go/bin:/c/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86:$PATH" CERT_FILE="$HOME/cert.pfx" make release-windows
49+
- run: PATH="$HOME/go/bin:/c/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86:$PATH" CERT_FILE="$HOME/cert.pfx" env -u TMPDIR make release-windows
4950
shell: bash
5051
env:
5152
CERT_PASS: ${{secrets.WINDOWS_CERT_PASS}}
5253
FORCE_LOCALIZE: true
53-
- run: make release-windows-rebuild
54+
- run: env -u TMPDIR make release-windows-rebuild
5455
shell: bash
5556
- uses: actions/upload-artifact@v1
5657
with:
@@ -64,13 +65,13 @@ jobs:
6465
go: ['1.19.x']
6566
steps:
6667
- uses: actions/checkout@v1
67-
- uses: actions/setup-ruby@v1
68+
- uses: ruby/setup-ruby@v1
69+
- run: gem install asciidoctor
6870
- uses: actions/setup-go@v2
6971
with:
7072
go-version: ${{ matrix.go }}
7173
- run: brew install gettext
7274
- run: brew install mitchellh/gon/gon
73-
- run: gem install asciidoctor
7475
- run: make release
7576
env:
7677
FORCE_LOCALIZE: true
@@ -100,7 +101,8 @@ jobs:
100101
go: ['1.19.x']
101102
steps:
102103
- uses: actions/checkout@v1
103-
- uses: actions/setup-ruby@v1
104+
- uses: ruby/setup-ruby@v1
105+
- run: gem install asciidoctor
104106
- uses: actions/setup-go@v2
105107
with:
106108
go-version: ${{ matrix.go }}
@@ -113,7 +115,6 @@ jobs:
113115
- uses: actions/download-artifact@v1
114116
with:
115117
name: macos-assets
116-
- run: gem install asciidoctor
117118
- run: CGO_ENABLED=0 make release
118119
- run: rm -f bin/releases/*windows* bin/releases/*darwin*
119120
- run: 'find windows-assets -name "*windows*" -type f | xargs -L1 -I{} mv {} bin/releases'
@@ -126,7 +127,7 @@ jobs:
126127
runs-on: ubuntu-20.04
127128
steps:
128129
- uses: actions/checkout@v1
129-
- uses: actions/setup-ruby@v1
130+
- uses: ruby/setup-ruby@v1
130131
- run: gem install packagecloud-ruby
131132
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
132133
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh)
@@ -144,13 +145,13 @@ jobs:
144145
container: [debian_11]
145146
steps:
146147
- uses: actions/checkout@v1
147-
- uses: actions/setup-ruby@v1
148+
- uses: ruby/setup-ruby@v1
149+
- run: gem install packagecloud-ruby
148150
- run: |
149151
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
150152
sudo systemctl restart docker.service
151153
docker version -f '{{.Server.Experimental}}'
152154
- uses: docker/setup-qemu-action@v1
153-
- run: gem install packagecloud-ruby
154155
- run: git clone https://github.com/git-lfs/build-dockers.git "$HOME/build-dockers"
155156
- run: (cd "$HOME/build-dockers" && ./build_dockers.bsh --arch=$ARCH $CONTAINER)
156157
env:

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.1.2

0 commit comments

Comments
 (0)