Not running on windows-latest Github runner
vinothsparrow opened this issue ยท 4 comments
Describe the problem
Getting this error while running on windows Github runner
Error: Error: Unable to locate executable file: powershell. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
To reproduce
name: Dev
on:
push:
branches: [dev]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v3
- name: install nodejs & yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.x"
Expected behavior
step successful
'arduino/setup-protoc' version
2.0.0
Additional context
No response
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest version
- My report contains all necessary details
๐ @vinothsparrow thanks for reporting this. I'm not able to reproduce the error with the snippet you provided.
I see that in the screenshot the workflow has a step called install golang
do you mind pasting here the code of that step? Are you using the actions/setup-go
action?
@alessio-perugini Sorry for not providing the entire workflow. Below is the full workflow of mine
name: Dev
on:
push:
branches: [dev]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: install nodejs & yarn
uses: actions/setup-node@v3
with:
node-version: 16
- name: "Get current release tag"
id: releasetag
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup node_modules cache
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: setup env
env:
VERSION: ${{ steps.releasetag.outputs.release }}
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
echo "PATH=$PATH:$GOPATH" >> $GITHUB_ENV
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV
- name: install golang
uses: actions/setup-go@v3
with:
go-version: "^1.19.2"
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
version: "23.x"
- name: install wire
shell: bash
run: go install github.com/google/wire/cmd/wire@latest
- name: install protoc-gen-go
shell: bash
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
And it's succeded on mac-latest runner only failing on windows-latest runner and on Install Protoc
step
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
echo "PATH=$PATH:$GOPATH" >> $GITHUB_ENV
Removing the line above seems to work. I didn't have enough time to dig deeper tho.
@alessio-perugini thanks for the quick update. yes, I was able to fix the issue by removing below step. ๐
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
echo "PATH=$PATH:$GOPATH" >> $GITHUB_ENV
Thanks for your help