相关疑难解决方法(0)

如何更新 Windows 最新托管运行程序的 github 操作工作流文件中的 PATH

我目前正在尝试将 GitHub 操作工作流添加到存储库...

要进行 C++/CMake/swig/python 开发(即本机 python 库开发),我需要下载并安装 swigwin 并使其在PATH...

不幸的$env:Path...是,在接下来的后续步骤中似乎没有考虑该命令

例子

name: Python Windows CI

on: [push, pull_request]

jobs:
  # Building using the GitHub runner environment directly.
  build:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v2
    - name: Check cmake
      run: cmake --version
    - name: Install swig
      run: |
        (New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.0.1.zip","swigwin-4.0.1.zip");
        Expand-Archive .\swigwin-4.0.1.zip .;
        $env:Path += ";.\swigwin-4.0.1";
        swig -version;
    - name: Check swig
      run: swig -version # swig cmdlet not found...

Run Code Online (Sandbox Code Playgroud)

观察到的

> Set up …
Run Code Online (Sandbox Code Playgroud)

powershell path github-actions

8
推荐指数
3
解决办法
4931
查看次数

标签 统计

github-actions ×1

path ×1

powershell ×1