From ae6c67ecea44681341ce1a354098866fadfcfd6d Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Sat, 22 Feb 2025 15:34:11 +0100 Subject: [PATCH 1/3] ci: separate lint, run tests on code changes --- .github/workflows/checks.yml | 35 +++++++++++++---------------------- .github/workflows/lint.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7498029454a..435e4cda843 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,5 +1,17 @@ name: checks -on: [pull_request, workflow_dispatch] +on: + pull_request: + paths: + - .github/workflows/checks.yml + - cmd/** + - pkg/** + - main.go + - .golangci.yml + - .goreleaser.yml + - codecov.yml + - go.mod + - go.sum + workflow_dispatch: concurrency: cancel-in-progress: true @@ -11,27 +23,6 @@ env: CGO_ENABLED: 0 jobs: - lint: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - - uses: golangci/golangci-lint-action@v6.5.0 - with: - version: v1.62 - - uses: megalinter/megalinter/flavors/go@v8.4.2 - env: - DEFAULT_BRANCH: master - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_ALL_CODEBASE: false - GITHUB_STATUS_REPORTER: ${{ !env.ACT }} - GITHUB_COMMENT_REPORTER: ${{ !env.ACT }} - test-linux: name: test-linux runs-on: ubuntu-latest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000000..6457c72d8f8 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: lint +on: [pull_request, workflow_dispatch] + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +env: + ACT_OWNER: ${{ github.repository_owner }} + ACT_REPOSITORY: ${{ github.repository }} + CGO_ENABLED: 0 + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - uses: golangci/golangci-lint-action@v6.5.0 + with: + version: v1.62 + - uses: megalinter/megalinter/flavors/go@v8.4.2 + env: + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: false + GITHUB_STATUS_REPORTER: ${{ !env.ACT }} + GITHUB_COMMENT_REPORTER: ${{ !env.ACT }} From 62013033efa011859afce85950bf900b520e6796 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Sat, 22 Feb 2025 15:51:06 +0100 Subject: [PATCH 2/3] git: add gitattributes --- .gitattributes | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..39fba5d06e1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Auto detect text files and perform normalization +* text=auto eol=lf + +*.sh text eol=lf +*.ps1 text eol=crlf + +*.go text diff=golang eol=lf + +# Ignore generated files +pkg/runner/testdata/actions/node*/node_modules/** -text +pkg/runner/testdata/actions/node*/dist/** -text From b395fbbccb082188f9375d769e5a782ec454902f Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Sat, 22 Feb 2025 16:15:44 +0100 Subject: [PATCH 3/3] git: renormalize files --- .../composite-fail-with-output/action.yml | 26 +-- .../composite-fail-with-output/push.yml | 28 ++-- .../testdata/evalmatrix-merge-array/push.yml | 24 +-- .../testdata/evalmatrix-merge-map/push.yml | 28 ++-- pkg/runner/testdata/evalmatrix/push.yml | 158 +++++++++--------- pkg/runner/testdata/evalmatrixneeds/push.yml | 48 +++--- pkg/runner/testdata/evalmatrixneeds2/push.yml | 58 +++---- pkg/runner/testdata/if-env-act/push.yml | 50 +++--- pkg/runner/testdata/nix-prepend-path/push.yml | 52 +++--- .../windows-add-env-powershell-5/push.yml | 96 +++++------ pkg/runner/testdata/windows-add-env/push.yml | 86 +++++----- .../push.yml | 68 ++++---- .../testdata/windows-prepend-path/push.yml | 68 ++++---- .../testdata/windows-shell-cmd/push.yml | 18 +- 14 files changed, 404 insertions(+), 404 deletions(-) diff --git a/pkg/runner/testdata/actions/composite-fail-with-output/action.yml b/pkg/runner/testdata/actions/composite-fail-with-output/action.yml index 896022aa798..bd33f3c08e0 100644 --- a/pkg/runner/testdata/actions/composite-fail-with-output/action.yml +++ b/pkg/runner/testdata/actions/composite-fail-with-output/action.yml @@ -1,13 +1,13 @@ -outputs: - customoutput: - value: my-customoutput-${{ steps.random-color-generator.outputs.SELECTED_COLOR }} -runs: - using: composite - steps: - - name: Set selected color - run: echo '::set-output name=SELECTED_COLOR::green' - id: random-color-generator - shell: bash - - name: fail - run: exit 1 - shell: bash \ No newline at end of file +outputs: + customoutput: + value: my-customoutput-${{ steps.random-color-generator.outputs.SELECTED_COLOR }} +runs: + using: composite + steps: + - name: Set selected color + run: echo '::set-output name=SELECTED_COLOR::green' + id: random-color-generator + shell: bash + - name: fail + run: exit 1 + shell: bash diff --git a/pkg/runner/testdata/composite-fail-with-output/push.yml b/pkg/runner/testdata/composite-fail-with-output/push.yml index b167d0025e8..a5496fd47ba 100644 --- a/pkg/runner/testdata/composite-fail-with-output/push.yml +++ b/pkg/runner/testdata/composite-fail-with-output/push.yml @@ -1,14 +1,14 @@ -name: composite-fail-with-output -on: push - -jobs: - test-for-output: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ./actions/composite-fail-with-output - id: composite-fail-with-output - continue-on-error: true - - run: | - echo ${{steps.composite-fail-with-output.outputs.customoutput}} - exit ${{steps.composite-fail-with-output.outputs.customoutput == 'my-customoutput-green' && '0' || '1'}} \ No newline at end of file +name: composite-fail-with-output +on: push + +jobs: + test-for-output: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./actions/composite-fail-with-output + id: composite-fail-with-output + continue-on-error: true + - run: | + echo ${{steps.composite-fail-with-output.outputs.customoutput}} + exit ${{steps.composite-fail-with-output.outputs.customoutput == 'my-customoutput-green' && '0' || '1'}} diff --git a/pkg/runner/testdata/evalmatrix-merge-array/push.yml b/pkg/runner/testdata/evalmatrix-merge-array/push.yml index 6a07e31eae2..a5c2d3ca545 100644 --- a/pkg/runner/testdata/evalmatrix-merge-array/push.yml +++ b/pkg/runner/testdata/evalmatrix-merge-array/push.yml @@ -1,12 +1,12 @@ -on: push -jobs: - a: - strategy: - matrix: - a: - - env: - key1: ${{'val'}}1 - - ${{fromJSON('[{"env":{"key2":"val2"}},{"env":{"key3":"val3"}}]')}} - runs-on: ubuntu-latest - steps: - - run: exit ${{ (matrix.a.env.key2 == 'val2' || matrix.a.env.key1 == 'val1' || matrix.a.env.key3 == 'val3' ) && '0' || '1' }} \ No newline at end of file +on: push +jobs: + a: + strategy: + matrix: + a: + - env: + key1: ${{'val'}}1 + - ${{fromJSON('[{"env":{"key2":"val2"}},{"env":{"key3":"val3"}}]')}} + runs-on: ubuntu-latest + steps: + - run: exit ${{ (matrix.a.env.key2 == 'val2' || matrix.a.env.key1 == 'val1' || matrix.a.env.key3 == 'val3' ) && '0' || '1' }} diff --git a/pkg/runner/testdata/evalmatrix-merge-map/push.yml b/pkg/runner/testdata/evalmatrix-merge-map/push.yml index 41d35b697f5..9ffee77b96f 100644 --- a/pkg/runner/testdata/evalmatrix-merge-map/push.yml +++ b/pkg/runner/testdata/evalmatrix-merge-map/push.yml @@ -1,14 +1,14 @@ -on: push -jobs: - a: - strategy: - matrix: - a: - - env: - key1: val1 - ${{insert}}: - key2: val2 - ${{ insert }}: ${{fromJSON('{"key3":"val3"}')}} - runs-on: ubuntu-latest - steps: - - run: exit ${{ (matrix.a.env.key2 == 'val2' && matrix.a.env.key1 == 'val1' && matrix.a.env.key3 == 'val3' ) && '0' || '1' }} \ No newline at end of file +on: push +jobs: + a: + strategy: + matrix: + a: + - env: + key1: val1 + ${{insert}}: + key2: val2 + ${{ insert }}: ${{fromJSON('{"key3":"val3"}')}} + runs-on: ubuntu-latest + steps: + - run: exit ${{ (matrix.a.env.key2 == 'val2' && matrix.a.env.key1 == 'val1' && matrix.a.env.key3 == 'val3' ) && '0' || '1' }} diff --git a/pkg/runner/testdata/evalmatrix/push.yml b/pkg/runner/testdata/evalmatrix/push.yml index dd742ecd116..ba268871c4d 100644 --- a/pkg/runner/testdata/evalmatrix/push.yml +++ b/pkg/runner/testdata/evalmatrix/push.yml @@ -1,79 +1,79 @@ -on: push -jobs: - evalm: - strategy: - matrix: |- - ${{fromJson(' - { - "A": [ "A", "B" ] - } - ')}} - runs-on: ubuntu-latest - steps: - - name: Check if the matrix key A exists - run: | - echo $MATRIX - exit ${{matrix.A && '0' || '1'}} - env: - MATRIX: ${{toJSON(matrix)}} - _additionalInclude_0: - strategy: - matrix: - include: - - def: val - runs-on: ubuntu-latest - steps: - - name: Check if the matrix key A exists - run: | - echo $MATRIX - exit ${{matrix.def == 'val' && '0' || '1'}} - env: - MATRIX: ${{toJSON(matrix)}} - - run: | - echo "::set-output name=result::success" - id: result - outputs: - result: ${{ steps.result.outputs.result }} - _additionalInclude_1: - needs: _additionalInclude_0 - if: always() - runs-on: ubuntu-latest - steps: - - name: Check if the matrix key A exists - run: | - echo $MATRIX - exit ${{needs._additionalInclude_0.outputs.result == 'success' && '0' || '1'}} - _additionalProperties_0: - strategy: - matrix: - x: - - 0 - y: - - 0 - z: - - 0 - include: - - def: val - z: 0 - runs-on: ubuntu-latest - steps: - - name: Check if the matrix key A exists - run: | - echo $MATRIX - exit ${{matrix.def == 'val' && matrix.x == 0 && matrix.y == 0 && matrix.z == 0 && '0' || '1'}} - env: - MATRIX: ${{toJSON(matrix)}} - - run: | - echo "::set-output name=result::success" - id: result - outputs: - result: ${{ steps.result.outputs.result }} - _additionalProperties_1: - needs: _additionalProperties_0 - if: always() - runs-on: ubuntu-latest - steps: - - name: Check if the matrix key A exists - run: | - echo $MATRIX - exit ${{needs._additionalProperties_0.outputs.result == 'success' && '0' || '1'}} +on: push +jobs: + evalm: + strategy: + matrix: |- + ${{fromJson(' + { + "A": [ "A", "B" ] + } + ')}} + runs-on: ubuntu-latest + steps: + - name: Check if the matrix key A exists + run: | + echo $MATRIX + exit ${{matrix.A && '0' || '1'}} + env: + MATRIX: ${{toJSON(matrix)}} + _additionalInclude_0: + strategy: + matrix: + include: + - def: val + runs-on: ubuntu-latest + steps: + - name: Check if the matrix key A exists + run: | + echo $MATRIX + exit ${{matrix.def == 'val' && '0' || '1'}} + env: + MATRIX: ${{toJSON(matrix)}} + - run: | + echo "::set-output name=result::success" + id: result + outputs: + result: ${{ steps.result.outputs.result }} + _additionalInclude_1: + needs: _additionalInclude_0 + if: always() + runs-on: ubuntu-latest + steps: + - name: Check if the matrix key A exists + run: | + echo $MATRIX + exit ${{needs._additionalInclude_0.outputs.result == 'success' && '0' || '1'}} + _additionalProperties_0: + strategy: + matrix: + x: + - 0 + y: + - 0 + z: + - 0 + include: + - def: val + z: 0 + runs-on: ubuntu-latest + steps: + - name: Check if the matrix key A exists + run: | + echo $MATRIX + exit ${{matrix.def == 'val' && matrix.x == 0 && matrix.y == 0 && matrix.z == 0 && '0' || '1'}} + env: + MATRIX: ${{toJSON(matrix)}} + - run: | + echo "::set-output name=result::success" + id: result + outputs: + result: ${{ steps.result.outputs.result }} + _additionalProperties_1: + needs: _additionalProperties_0 + if: always() + runs-on: ubuntu-latest + steps: + - name: Check if the matrix key A exists + run: | + echo $MATRIX + exit ${{needs._additionalProperties_0.outputs.result == 'success' && '0' || '1'}} diff --git a/pkg/runner/testdata/evalmatrixneeds/push.yml b/pkg/runner/testdata/evalmatrixneeds/push.yml index 30f52acd1e5..be6213adf1e 100644 --- a/pkg/runner/testdata/evalmatrixneeds/push.yml +++ b/pkg/runner/testdata/evalmatrixneeds/push.yml @@ -1,24 +1,24 @@ -on: push -jobs: - prepare: - runs-on: ubuntu-latest - steps: - - run: | - echo '::set-output name=matrix::{"package": ["a", "b"]}' - id: r1 - outputs: - matrix: ${{steps.r1.outputs.matrix}} - evalm: - needs: - - prepare - strategy: - matrix: |- - ${{fromJson(needs.prepare.outputs.matrix)}} - runs-on: ubuntu-latest - steps: - - name: Check if the matrix key package exists - run: | - echo $MATRIX - exit ${{matrix.package && '0' || '1'}} - env: - MATRIX: ${{toJSON(matrix)}} \ No newline at end of file +on: push +jobs: + prepare: + runs-on: ubuntu-latest + steps: + - run: | + echo '::set-output name=matrix::{"package": ["a", "b"]}' + id: r1 + outputs: + matrix: ${{steps.r1.outputs.matrix}} + evalm: + needs: + - prepare + strategy: + matrix: |- + ${{fromJson(needs.prepare.outputs.matrix)}} + runs-on: ubuntu-latest + steps: + - name: Check if the matrix key package exists + run: | + echo $MATRIX + exit ${{matrix.package && '0' || '1'}} + env: + MATRIX: ${{toJSON(matrix)}} diff --git a/pkg/runner/testdata/evalmatrixneeds2/push.yml b/pkg/runner/testdata/evalmatrixneeds2/push.yml index 225b518b4b0..162185c477b 100644 --- a/pkg/runner/testdata/evalmatrixneeds2/push.yml +++ b/pkg/runner/testdata/evalmatrixneeds2/push.yml @@ -1,29 +1,29 @@ -on: push -jobs: - prepare: - runs-on: ubuntu-latest - steps: - - run: | - echo '::set-output name=matrix::["a", "b"]' - id: r1 - outputs: - matrix: ${{steps.r1.outputs.matrix}} - helix: steady - evalm: - needs: - - prepare - strategy: - matrix: - ${{needs.prepare.outputs.helix}}: |- - ${{fromJson(needs.prepare.outputs.matrix)}} - runs-on: ubuntu-latest - steps: - - name: Check if the matrix key doesn't ends up unevaluated - run: | - echo $MATRIX - exit ${{matrix['${{needs.prepare.outputs.helix}}'] && '1' || '0'}} - env: - MATRIX: ${{toJSON(matrix)}} - - name: Check if the evaluated matrix key contains a value - run: | - exit ${{matrix[needs.prepare.outputs.helix] && '0' || '1'}} +on: push +jobs: + prepare: + runs-on: ubuntu-latest + steps: + - run: | + echo '::set-output name=matrix::["a", "b"]' + id: r1 + outputs: + matrix: ${{steps.r1.outputs.matrix}} + helix: steady + evalm: + needs: + - prepare + strategy: + matrix: + ${{needs.prepare.outputs.helix}}: |- + ${{fromJson(needs.prepare.outputs.matrix)}} + runs-on: ubuntu-latest + steps: + - name: Check if the matrix key doesn't ends up unevaluated + run: | + echo $MATRIX + exit ${{matrix['${{needs.prepare.outputs.helix}}'] && '1' || '0'}} + env: + MATRIX: ${{toJSON(matrix)}} + - name: Check if the evaluated matrix key contains a value + run: | + exit ${{matrix[needs.prepare.outputs.helix] && '0' || '1'}} diff --git a/pkg/runner/testdata/if-env-act/push.yml b/pkg/runner/testdata/if-env-act/push.yml index 0bf50171e7c..b8d9fb6921c 100644 --- a/pkg/runner/testdata/if-env-act/push.yml +++ b/pkg/runner/testdata/if-env-act/push.yml @@ -1,25 +1,25 @@ -name: if-env-act-test -on: push - -jobs: - if_env_test: - name: Test if env.ACT matching - runs-on: ubuntu-latest - steps: - # Should RUN, since we are running in act - - name: Positive env.ACT match - if: ${{ env.ACT }} - shell: bash - run: | - echo "This workflow is run using act, continue!" - echo "ACT: $ACT" - exit 0 - - # Should SKIP, since we are running in act - - name: Negative env.ACT match - if: ${{ !env.ACT }} - shell: bash - run: | - echo "This should be skipped since this workflow is run using act, fail!" - echo "ACT: $ACT" - exit 1 \ No newline at end of file +name: if-env-act-test +on: push + +jobs: + if_env_test: + name: Test if env.ACT matching + runs-on: ubuntu-latest + steps: + # Should RUN, since we are running in act + - name: Positive env.ACT match + if: ${{ env.ACT }} + shell: bash + run: | + echo "This workflow is run using act, continue!" + echo "ACT: $ACT" + exit 0 + + # Should SKIP, since we are running in act + - name: Negative env.ACT match + if: ${{ !env.ACT }} + shell: bash + run: | + echo "This should be skipped since this workflow is run using act, fail!" + echo "ACT: $ACT" + exit 1 diff --git a/pkg/runner/testdata/nix-prepend-path/push.yml b/pkg/runner/testdata/nix-prepend-path/push.yml index 71fd5bc7f53..4d262430d6e 100644 --- a/pkg/runner/testdata/nix-prepend-path/push.yml +++ b/pkg/runner/testdata/nix-prepend-path/push.yml @@ -1,26 +1,26 @@ -on: - push: -defaults: - run: - shell: sh -jobs: - test: - runs-on: self-hosted - steps: - - run: | - mkdir build - echo '#!/usr/bin/env sh' > build/testtool - echo 'echo Hi' >> build/testtool - chmod +x build/testtool - - run: | - echo '${{ tojson(runner) }}' - ls - echo '${{ github.workspace }}' - working-directory: ${{ github.workspace }}/build - - run: | - echo "$GITHUB_PATH" - echo '${{ github.workspace }}/build' > "$GITHUB_PATH" - cat "$GITHUB_PATH" - - run: | - echo "$PATH" - testtool +on: + push: +defaults: + run: + shell: sh +jobs: + test: + runs-on: self-hosted + steps: + - run: | + mkdir build + echo '#!/usr/bin/env sh' > build/testtool + echo 'echo Hi' >> build/testtool + chmod +x build/testtool + - run: | + echo '${{ tojson(runner) }}' + ls + echo '${{ github.workspace }}' + working-directory: ${{ github.workspace }}/build + - run: | + echo "$GITHUB_PATH" + echo '${{ github.workspace }}/build' > "$GITHUB_PATH" + cat "$GITHUB_PATH" + - run: | + echo "$PATH" + testtool diff --git a/pkg/runner/testdata/windows-add-env-powershell-5/push.yml b/pkg/runner/testdata/windows-add-env-powershell-5/push.yml index 35824768455..07c3230a5a3 100644 --- a/pkg/runner/testdata/windows-add-env-powershell-5/push.yml +++ b/pkg/runner/testdata/windows-add-env-powershell-5/push.yml @@ -1,48 +1,48 @@ -on: - push: -jobs: - test: - runs-on: windows-latest - steps: - - run: | - echo $env:GITHUB_ENV - echo "key=val" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "key2<> $env:GITHUB_ENV - echo "key2<> $env:GITHUB_ENV - echo "line1" >> $env:GITHUB_ENV - echo "line2" >> $env:GITHUB_ENV - echo "EOF" >> $env:GITHUB_ENV - cat $env:GITHUB_ENV - - run: | - ls env: - if($env:key -ne 'val') { - echo "Unexpected value for `$env:key: $env:key" - exit 1 - } - if($env:key2 -ne "line1`nline2") { - echo "Unexpected value for `$env:key2: $env:key2" - exit 1 - } - - run: | - echo $env:GITHUB_ENV - # Defect missing append - echo "KEY=test" > $env:GITHUB_ENV - # Defect missing append, test is broken!!! - echo "Key=expected" > $env:GITHUB_ENV - - name: Assert GITHUB_ENV is merged case insensitive - run: exit 1 - if: env.KEY != 'expected' || env.Key != 'expected' || env.key != 'expected' - - name: Assert step env is merged case insensitive - run: exit 1 - if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a' - env: - KeY: 'n/a' - - uses: actions/checkout@v3 - - uses: ./windows-add-env/action - - name: Assert composite env is merged case insensitive - run: exit 1 - if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a' \ No newline at end of file +on: + push: +jobs: + test: + runs-on: windows-latest + steps: + - run: | + echo $env:GITHUB_ENV + echo "key=val" >> $env:GITHUB_ENV + echo "key2<> $env:GITHUB_ENV + echo "line1" >> $env:GITHUB_ENV + echo "line2" >> $env:GITHUB_ENV + echo "EOF" >> $env:GITHUB_ENV + cat $env:GITHUB_ENV + - run: | + ls env: + if($env:key -ne 'val') { + echo "Unexpected value for `$env:key: $env:key" + exit 1 + } + if($env:key2 -ne "line1`nline2") { + echo "Unexpected value for `$env:key2: $env:key2" + exit 1 + } + - run: | + echo $env:GITHUB_ENV + # Defect missing append + echo "KEY=test" > $env:GITHUB_ENV + # Defect missing append, test is broken!!! + echo "Key=expected" > $env:GITHUB_ENV + - name: Assert GITHUB_ENV is merged case insensitive + run: exit 1 + if: env.KEY != 'expected' || env.Key != 'expected' || env.key != 'expected' + - name: Assert step env is merged case insensitive + run: exit 1 + if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a' + env: + KeY: 'n/a' + - uses: actions/checkout@v3 + - uses: ./windows-add-env/action + - name: Assert composite env is merged case insensitive + run: exit 1 + if: env.KEY != 'n/a' || env.Key != 'n/a' || env.key != 'n/a' diff --git a/pkg/runner/testdata/windows-prepend-path-powershell-5/push.yml b/pkg/runner/testdata/windows-prepend-path-powershell-5/push.yml index 7468b45aabf..407f9c3830c 100644 --- a/pkg/runner/testdata/windows-prepend-path-powershell-5/push.yml +++ b/pkg/runner/testdata/windows-prepend-path-powershell-5/push.yml @@ -1,34 +1,34 @@ -on: - push: -defaults: - run: - shell: powershell -jobs: - test: - runs-on: windows-latest - steps: - - run: | - mkdir build - echo '@echo off' | Out-File -FilePath build/test.cmd -Encoding utf8 - echo 'echo Hi' | Out-File -FilePath build/test.cmd -Encoding utf8 -Append - mkdir build2 - echo '@echo off' | Out-File -FilePath build/test2.cmd -Encoding utf8 - echo 'echo test2' | Out-File -FilePath build/test2.cmd -Encoding utf8 -Append - - run: | - echo '${{ tojson(runner) }}' - ls - echo '${{ github.workspace }}' - working-directory: ${{ github.workspace }}\build - - run: | - echo $env:GITHUB_PATH - echo '${{ github.workspace }}\build' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - cat $env:GITHUB_PATH - - run: | - echo $env:PATH - test - - run: | - echo "PATH=$env:PATH;${{ github.workspace }}\build2" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - run: | - echo $env:PATH - test - test2 \ No newline at end of file +on: + push: +defaults: + run: + shell: powershell +jobs: + test: + runs-on: windows-latest + steps: + - run: | + mkdir build + echo '@echo off' | Out-File -FilePath build/test.cmd -Encoding utf8 + echo 'echo Hi' | Out-File -FilePath build/test.cmd -Encoding utf8 -Append + mkdir build2 + echo '@echo off' | Out-File -FilePath build/test2.cmd -Encoding utf8 + echo 'echo test2' | Out-File -FilePath build/test2.cmd -Encoding utf8 -Append + - run: | + echo '${{ tojson(runner) }}' + ls + echo '${{ github.workspace }}' + working-directory: ${{ github.workspace }}\build + - run: | + echo $env:GITHUB_PATH + echo '${{ github.workspace }}\build' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + cat $env:GITHUB_PATH + - run: | + echo $env:PATH + test + - run: | + echo "PATH=$env:PATH;${{ github.workspace }}\build2" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + - run: | + echo $env:PATH + test + test2 diff --git a/pkg/runner/testdata/windows-prepend-path/push.yml b/pkg/runner/testdata/windows-prepend-path/push.yml index cf5026a6b6e..d30a757c61c 100644 --- a/pkg/runner/testdata/windows-prepend-path/push.yml +++ b/pkg/runner/testdata/windows-prepend-path/push.yml @@ -1,34 +1,34 @@ -on: - push: -defaults: - run: - shell: pwsh -jobs: - test: - runs-on: windows-latest - steps: - - run: | - mkdir build - echo '@echo off' > build/test.cmd - echo 'echo Hi' >> build/test.cmd - mkdir build2 - echo '@echo off' > build2/test2.cmd - echo 'echo test2' >> build2/test2.cmd - - run: | - echo '${{ tojson(runner) }}' - ls - echo '${{ github.workspace }}' - working-directory: ${{ github.workspace }}\build - - run: | - echo $env:GITHUB_PATH - echo '${{ github.workspace }}\build' > $env:GITHUB_PATH - cat $env:GITHUB_PATH - - run: | - echo $env:PATH - test - - run: | - echo "PATH=$env:PATH;${{ github.workspace }}\build2" > $env:GITHUB_ENV - - run: | - echo $env:PATH - test - test2 \ No newline at end of file +on: + push: +defaults: + run: + shell: pwsh +jobs: + test: + runs-on: windows-latest + steps: + - run: | + mkdir build + echo '@echo off' > build/test.cmd + echo 'echo Hi' >> build/test.cmd + mkdir build2 + echo '@echo off' > build2/test2.cmd + echo 'echo test2' >> build2/test2.cmd + - run: | + echo '${{ tojson(runner) }}' + ls + echo '${{ github.workspace }}' + working-directory: ${{ github.workspace }}\build + - run: | + echo $env:GITHUB_PATH + echo '${{ github.workspace }}\build' > $env:GITHUB_PATH + cat $env:GITHUB_PATH + - run: | + echo $env:PATH + test + - run: | + echo "PATH=$env:PATH;${{ github.workspace }}\build2" > $env:GITHUB_ENV + - run: | + echo $env:PATH + test + test2 diff --git a/pkg/runner/testdata/windows-shell-cmd/push.yml b/pkg/runner/testdata/windows-shell-cmd/push.yml index ea672a30218..f9dfdebf1a5 100644 --- a/pkg/runner/testdata/windows-shell-cmd/push.yml +++ b/pkg/runner/testdata/windows-shell-cmd/push.yml @@ -1,9 +1,9 @@ -on: - push: -jobs: - test: - runs-on: windows-latest - steps: - - run: | - echo Hi - shell: cmd \ No newline at end of file +on: + push: +jobs: + test: + runs-on: windows-latest + steps: + - run: | + echo Hi + shell: cmd