簡體   English   中英

Python 使用 Github 測試 Windows 上的操作

[英]Python testing with Github Actions on Windows

我正在嘗試使用 ZD3B7C913CD045EBFEC0E9EC32CCBZ6 操作在 Windows 上測試 Python package。 以下作業描述在 Linux 和 MacOS 上是成功的,但在 Windows 上,最終的Test ${{ matrix.os }} binding部分失敗。

  test:
    strategy:
      matrix:
        os: [windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v1
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          default: true
      - name: Unit tests
        run: cargo test
      - uses: actions/setup-python@v1
        with:
          python-version: '3.7'
      - name: Test ${{ matrix.os }} binding
        run: |
          python3 -m venv venv3
          venv3\Scripts\Activate.ps1
          python3 -m pip install maturin numpy
          maturin develop
          python3 -m unittest discover tests

這是生成的錯誤日志。

2020-05-02T11:26:46.8753138Z ##[group]Run actions/setup-python@v1
2020-05-02T11:26:46.8753394Z with:
2020-05-02T11:26:46.8753556Z   python-version: 3.7
2020-05-02T11:26:46.8753701Z   architecture: x64
2020-05-02T11:26:46.8753843Z ##[endgroup]
2020-05-02T11:26:46.9972224Z Successfully setup CPython (3.7.6)
2020-05-02T11:26:47.0429209Z ##[group]Run python3 -m venv venv3
2020-05-02T11:26:47.0429485Z python3 -m venv venv3
2020-05-02T11:26:47.0429617Z venv3\Scripts\Activate.ps1
2020-05-02T11:26:47.0429746Z python3 -m pip install maturin numpy
2020-05-02T11:26:47.0429871Z maturin develop
2020-05-02T11:26:47.0430000Z python3 -m unittest discover tests
2020-05-02T11:26:47.0470479Z shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
2020-05-02T11:26:47.0470607Z env:
2020-05-02T11:26:47.0470733Z   pythonLocation: C:\hostedtoolcache\windows\Python\3.7.6\x64
2020-05-02T11:26:47.0470858Z ##[endgroup]
2020-05-02T11:26:57.7836092Z ##[error]Process completed with exit code 1.
2020-05-02T11:26:57.7855441Z Cleaning up orphan processes

我不清楚它為什么會失敗。

The Python 3 executable is usually available with python3 on Linux and Mac, where the default python might the old Python 2. This is not the case on Windows so the solution is just to use python .

暫無
暫無

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

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