簡體   English   中英

如何在 Windows 版本的 GitHub 操作上設置 Bakeware env vars?

[英]How to set Bakeware env vars on GitHub Actions for a Windows release?

背景

我正在嘗試獲得與 Windows 和Bakeware一起使用的 Github 操作,因為我正在嘗試使用它創建一個版本。

但是,我遇到了環境變量的問題。

代碼

在 Bakeware 的設置頁面中提到我們必須設置MAKECC環境變量:

在我的 Github 操作中,這正是我所做的(我認為):

name: build

env:
  MIX_ENV: test
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: Build on Windows
    runs-on: windows-2019
    env: 
        CC: gcc
        MAKE: make

    steps:
    - uses: actions/checkout@v2
    - uses: erlef/setup-beam@v1
      with:
        elixir-version: '1.13.x' # Define the elixir version [required]
        otp-version: '24.2.x' # Define the OTP version [required]
    
    - name: Install choco
      shell: powershell
      run: |
        Set-ExecutionPolicy -ExecutionPolicy Bypass
        Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

    - name: Install bakeware dependencies
      shell: powershell
      run: choco install -y zstandard make mingw

    - name: Install Dependencies
      shell: powershell
      run: mix deps.get
 
    - name: Run credo code analyser
      shell: powershell
      run: mix credo --strict

我什至正在使用 powershell 來做到這一點(即使我不確定是否需要這樣做)。

問題

但是我的 GitHub Actions 代碼返回此錯誤:

==> bakeware

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj"

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/launcher"

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress"

mkdir: cannot create directory 'd:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress': No such file or directory

make: *** [Makefile:70: d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress] Error 1

could not compile dependency :bakeware, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile bakeware", update it with "mix deps.update bakeware" or clean it with "mix deps.clean bakeware"

** (Mix) Could not compile with "make" (exit status: 2).

它說它不能用make編譯。

問題

我嘗試復制/粘貼該部分:

env: 
  CC: gcc
  MAKE: make

對於我能想到的該文件中的每個部分,但我總是遇到同樣的問題。

我究竟做錯了什么?

回答

在這種情況下,環境變量已正確創建和設置。 問題更深,它與庫本身無法創建所需的文件夾有關。

因為庫使用的make工具需要這些文件夾,所以該工具會自行崩潰並報告,因此讓我相信我的環境設置存在問題,因為我收到了錯誤:

 (Mix) Could not compile with "make" (exit status: 2).

然而實際上,這個問題是庫中的一個錯誤,這個問題已經在 master 中修復:

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM