Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
35 changes: 13 additions & 22 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 13 additions & 13 deletions pkg/runner/testdata/actions/composite-fail-with-output/action.yml
Original file line number Diff line number Diff line change
@@ -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
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
28 changes: 14 additions & 14 deletions pkg/runner/testdata/composite-fail-with-output/push.yml
Original file line number Diff line number Diff line change
@@ -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'}}
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'}}
24 changes: 12 additions & 12 deletions pkg/runner/testdata/evalmatrix-merge-array/push.yml
Original file line number Diff line number Diff line change
@@ -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' }}
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' }}
28 changes: 14 additions & 14 deletions pkg/runner/testdata/evalmatrix-merge-map/push.yml
Original file line number Diff line number Diff line change
@@ -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' }}
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' }}
158 changes: 79 additions & 79 deletions pkg/runner/testdata/evalmatrix/push.yml
Original file line number Diff line number Diff line change
@@ -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'}}
Loading
Loading