配置脚本可以在github Action上的Windows上查找GREP
我正在尝试使 pr 构建我的haskell project 在github操作上的Windows上,但是 process> process-1.6.14.0
找不到GREP
。完整的GA日志为在这里=“ https://gist.github.com/toku-sa-n/749cc0fe49638c0fa9d763a9d763a920c7301f” rel =“ nofollow noreferrer”>在这里时间过期)。
GREP
安装在/usr/bin/grep
上。
which grep
grep --version
/usr/bin/grep --version
shell: D:\a\_temp\setup-msys2\msys2.CMD {0}
env:
MSYSTEM: MINGW64
/usr/bin/grep
grep (GNU grep) 3.0
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
grep (GNU grep) 3.0
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
但是,配置脚本找不到。
checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found in /mingw64/bin:/c/Users/runneradmin/AppData/Roaming/cabal/bin:/usr/bin:/d/a/_temp/msys64/mingw64/bin:/d/a/_temp/msys64/usr/local/bin:/d/a/_temp/msys64/usr/bin:/d/a/_temp/msys64/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/d/a/_temp/msys64/usr/bin/site_perl:/d/a/_temp/msys64/usr/bin/vendor_perl:/d/a/_temp/msys64/usr/bin/core_perl;/usr/xpg4/bin
我认为GREP
满足所有要求,因为我可以在我的本地窗口上构建Process-1.6.14.0
,其中具有相同版本的grep
。
这是GA脚本。
name: Haskell CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
strategy:
matrix:
sys:
- { os: ubuntu-latest, shell: bash }
- { os: windows-latest, shell: 'msys2 {0}' }
runs-on: ${{ matrix.sys.os }}
defaults:
run:
shell: ${{ matrix.sys.shell }}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
update: true
install: |
base-devel
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-freeglut
mingw-w64-x86_64-glew
mingw-w64-x86_64-freetype
if: runner.os == 'Windows'
- uses: haskell/actions/setup@v1
id: haskell_setup
with:
ghc-version: '8.10.7'
cabal-version: '3.6.0.0'
# Adding a path to msys2's PATH on GitHub Actions is pretty troublesome. So I'll output the path to a file.
# (See https://github.com/msys2/setup-msys2/issues/98 to how to add a path to PATH.)
- name: Store the path to Cabal (Windows)
run: |
echo "$(cygpath --unix '${{ steps.haskell_setup.outputs.cabal-exe }}') "'$@ '"-w $(cygpath --unix '${{ steps.haskell_setup.outputs.ghc-exe }}')" > cabal.sh
chmod +x cabal.sh
if: runner.os == 'Windows'
- name: Store the path to Cabal (Linux)
run: |
echo '${{ steps.haskell_setup.outputs.cabal-exe }} $@' > cabal.sh
chmod +x cabal.sh
if: runner.os == 'Linux'
- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}
- name: Install dependencies (Linux)
run: |
sudo apt update
sudo apt install libsdl2-dev libglew-dev moreutils
if: runner.os == 'Linux'
- name: Update Cabal
run: ./cabal.sh update
- name: Test grep
run: |
which grep
grep --version
/usr/bin/grep --version
if: runner.os == 'Windows'
- name: Build
run: ./cabal.sh build --enable-tests --enable-benchmarks all -j
- name: Run tests
run: ./cabal.sh test all -j
format_and_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: '8.10.7'
cabal-version: '3.6.0.0'
- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}
- name: Update the PATH environment variable
run: echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
sudo apt update
sudo apt install libsdl2-dev libglew-dev moreutils
cabal update -j
# See https://tokuchan3515.hatenablog.com/entry/2022/03/26/133158 why we separate `cabal install`s.
cabal install weeder -j -z
cabal install hindent -j -z
cabal install stylish-haskell -j -z
- name: Generate `cabal.project.local` for `weeder`
run: "echo \"package * \n ghc-options: -fwrite-ide-info\" > cabal.project.local"
- name: Detect unused lines
run: |
cabal clean # This is necessary to run `weeder` correctly. See https://hackage.haskell.org/package/weeder.
weeder
- name: Set up HLint
uses: haskell/actions/hlint-setup@v1
- name: Run HLint
uses: haskell/actions/hlint-run@v1
with:
path: '["src/", "tests/", "app/"]'
fail-on: warning
- name: Check format
run: ./formatter.sh --check
为什么在GA上构建失败?
I'm trying to make a PR to build my Haskell project on Windows on Github Actions, but the configuration script of the process-1.6.14.0
can't find grep
. The complete GA log is here and here (the same log but I've uploaded it as a Gists in case the log retention time is expired).
grep
is installed on /usr/bin/grep
.
which grep
grep --version
/usr/bin/grep --version
shell: D:\a\_temp\setup-msys2\msys2.CMD {0}
env:
MSYSTEM: MINGW64
/usr/bin/grep
grep (GNU grep) 3.0
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
grep (GNU grep) 3.0
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
However, the configuration script can't find it.
checking for grep that handles long lines and -e... configure: error: no acceptable grep could be found in /mingw64/bin:/c/Users/runneradmin/AppData/Roaming/cabal/bin:/usr/bin:/d/a/_temp/msys64/mingw64/bin:/d/a/_temp/msys64/usr/local/bin:/d/a/_temp/msys64/usr/bin:/d/a/_temp/msys64/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/d/a/_temp/msys64/usr/bin/site_perl:/d/a/_temp/msys64/usr/bin/vendor_perl:/d/a/_temp/msys64/usr/bin/core_perl;/usr/xpg4/bin
I think that grep
satisfies all the requirements because I could build process-1.6.14.0
on my local Windows with the same version of grep
.
Here is the GA script.
name: Haskell CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
strategy:
matrix:
sys:
- { os: ubuntu-latest, shell: bash }
- { os: windows-latest, shell: 'msys2 {0}' }
runs-on: ${{ matrix.sys.os }}
defaults:
run:
shell: ${{ matrix.sys.shell }}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
update: true
install: |
base-devel
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-freeglut
mingw-w64-x86_64-glew
mingw-w64-x86_64-freetype
if: runner.os == 'Windows'
- uses: haskell/actions/setup@v1
id: haskell_setup
with:
ghc-version: '8.10.7'
cabal-version: '3.6.0.0'
# Adding a path to msys2's PATH on GitHub Actions is pretty troublesome. So I'll output the path to a file.
# (See https://github.com/msys2/setup-msys2/issues/98 to how to add a path to PATH.)
- name: Store the path to Cabal (Windows)
run: |
echo "$(cygpath --unix '${{ steps.haskell_setup.outputs.cabal-exe }}') "'$@ '"-w $(cygpath --unix '${{ steps.haskell_setup.outputs.ghc-exe }}')" > cabal.sh
chmod +x cabal.sh
if: runner.os == 'Windows'
- name: Store the path to Cabal (Linux)
run: |
echo '${{ steps.haskell_setup.outputs.cabal-exe }} $@' > cabal.sh
chmod +x cabal.sh
if: runner.os == 'Linux'
- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}
- name: Install dependencies (Linux)
run: |
sudo apt update
sudo apt install libsdl2-dev libglew-dev moreutils
if: runner.os == 'Linux'
- name: Update Cabal
run: ./cabal.sh update
- name: Test grep
run: |
which grep
grep --version
/usr/bin/grep --version
if: runner.os == 'Windows'
- name: Build
run: ./cabal.sh build --enable-tests --enable-benchmarks all -j
- name: Run tests
run: ./cabal.sh test all -j
format_and_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: '8.10.7'
cabal-version: '3.6.0.0'
- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ hashFiles('cabal.project.freeze') }}
- name: Update the PATH environment variable
run: echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
sudo apt update
sudo apt install libsdl2-dev libglew-dev moreutils
cabal update -j
# See https://tokuchan3515.hatenablog.com/entry/2022/03/26/133158 why we separate `cabal install`s.
cabal install weeder -j -z
cabal install hindent -j -z
cabal install stylish-haskell -j -z
- name: Generate `cabal.project.local` for `weeder`
run: "echo \"package * \n ghc-options: -fwrite-ide-info\" > cabal.project.local"
- name: Detect unused lines
run: |
cabal clean # This is necessary to run `weeder` correctly. See https://hackage.haskell.org/package/weeder.
weeder
- name: Set up HLint
uses: haskell/actions/hlint-setup@v1
- name: Run HLint
uses: haskell/actions/hlint-run@v1
with:
path: '["src/", "tests/", "app/"]'
fail-on: warning
- name: Check format
run: ./formatter.sh --check
Why is the build failed on GA?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
配置脚本接受
grep
变量,以指定GREP
是。因此,我更新了GA脚本。The configuration script accepts the
GREP
variable to specify wheregrep
is. So, I updated the GA script.