在GitHub动作工作流程中的&&
上使用windows-latest
oprerator时出现错误,但我不知道为什么。我在ubuntu-latest
上没有此错误。
GitHub使用的命令行界面是什么?是cmd
吗?是PowerShell
吗?
错误提示
Run cd ./test && mkdir build && cd ./build && cmake -G"Unix Makefiles" ./..
At D:\a\_temp\7d2f0062-3ec5-48db-9ed0-235006d396e6.ps1:2 char:11
+ cd ./test && mkdir build && cd ./build && cmake -G"Unix Makefiles" ./ ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At D:\a\_temp\7d2f0062-3ec5-48db-9ed0-235006d396e6.ps1:2 char:26
+ cd ./test && mkdir build && cd ./build && cmake -G"Unix Makefiles" ./ ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At D:\a\_temp\7d2f0062-3ec5-48db-9ed0-235006d396e6.ps1:2 char:40
+ cd ./test && mkdir build && cd ./build && cmake -G"Unix Makefiles" ./ ...
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : InvalidEndOfLine
这是我的GitHub操作流程:
BuildJob.yml
name: C/C++ CI
on: [push]
jobs:
Linux-job:
name: Run unit tests on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: CMake
run: cd ./test && mkdir build && cd ./build && cmake -G"Unix Makefiles" ./..
- name: make
run: cd ./test/build && make
- name: execute tests
run: ./test/build/Test.out
Windows-job:
name: Run unit tests on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: CMake
run: cd ./test && mkdir build && cd ./build && cmake -G"Unix Makefiles" ./..
- name: make
run: cd ./test/build && make
- name: execute tests
run: ./test/build/Test.out
编辑:
此外,当我在Linux上使用make编译时,我的include就像
#include "StatisticAnalysis.hpp"
变得区分大小写,很奇怪...