Implicit Syntax Validation for pipelines #838
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dotnet tool | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
package: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.build.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0.x' | |
- name: GenerateConstant | |
run: dotnet msbuild ./dir.proj -t:GenerateConstant /p:RunnerVersion=$(Get-Content ./runnerversion) /p:PackageRuntime=any | |
shell: pwsh | |
working-directory: ./src | |
- name: Restore | |
run: dotnet restore /p:RuntimeFrameworkVersion=6.0.0 | |
shell: pwsh | |
working-directory: ./src/Runner.Client | |
- name: Build | |
id: build | |
run: | | |
$d = Get-Date | |
$version = $("$(gh release view --repo ${{ github.server_url }}/${{ github.repository }} --json tagName -t "{{.tagName}}")".TrimStart("v") + "-preview." + $d.Year + "." + $d.Month + "." + $d.Day + "." + $d.Hour + "." + $d.Minute + "." + $d.Second + "." + $ENV:GITHUB_RUN_ID) | |
dotnet build --no-restore -c Release /p:BUILD_OS=Any /p:Version=$version /p:RuntimeFrameworkVersion=6.0.0 | |
echo "version=$version" > $env:GITHUB_OUTPUT | |
shell: pwsh | |
working-directory: ./src/Runner.Client | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Pack | |
run: | | |
dotnet pack --no-restore -c Release --no-build /p:Version=${{steps.build.outputs.version}} /p:RuntimeFrameworkVersion=6.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} | |
shell: pwsh | |
working-directory: ./src/Runner.Client | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nupkg | |
path: src/Runner.Client/nupkg | |
- name: Push to Nuget | |
if: false && env.GHARUN != '' | |
run: dotnet nuget push ./*.nupkg --api-key $($ENV:GHARUN) --source https://api.nuget.org/v3/index.json | |
shell: pwsh | |
working-directory: ./src/Runner.Client/nupkg | |
env: | |
GHARUN: ${{secrets.GHARUN}} | |
- name: Push to GitHub Packages | |
if: ${{ github.server_url == 'https://github.com' && github.event_name == 'push' && github.ref_name == 'main' }} | |
run: | | |
dotnet nuget push ./*.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --no-symbols | |
working-directory: ./src/Runner.Client/nupkg | |
continue-on-error: true | |
test: | |
defaults: | |
run: | |
# It seems pwsh doesn't failfast, windows jobs succeeded with errors | |
shell: ${{ matrix.shell || 'bash' }} | |
needs: | |
- package | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- windows-2022 | |
- ubuntu-latest | |
- macos-latest | |
dotnet-version: | |
# - '6.0.100' | |
- '6.0.x' | |
image: | |
- '' | |
include: | |
- os: windows-2022 | |
tag: ltsc2022 | |
- os: ubuntu-latest | |
image: mcr.microsoft.com/dotnet/sdk:6.0-alpine3.15 | |
shell: sh | |
runs-on: ${{matrix.os}} | |
container: ${{matrix.image}} | |
steps: | |
- uses: actions/checkout@v3 | |
- if: matrix.dotnet-version | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{matrix.dotnet-version}} | |
- run: mkdir src/Runner.Client/nupkg | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: nupkg | |
path: src/Runner.Client/nupkg | |
- name: Install | |
run: | | |
dotnet tool install -g io.github.christopherhx.gharun --add-source src/Runner.Client/nupkg --version ${{needs.package.outputs.version}} | |
# Make shure to have gharun in path in job container | |
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH | |
- name: Test | |
run: | | |
set -x | |
gharun -C testworkflows/workflowerrors || : | |
gharun -C testworkflows/workflowerrors --trace --var system.runner.server.sendlostevents=true || : | |
gharun -W testworkflows/testlocalcheckout.yml | |
gharun -W testworkflows/testhashfiles.yml | |
gharun -W testworkflows/dumpcontexts.yml | |
gharun -W testworkflows/multiline_secrets.yml --secret-file testworkflows/multiline_secrets.secrets | |
gharun -W testworkflows/multiline_env.yml --env-file testworkflows/multiline_secrets.secrets | |
gharun -W testworkflows/multiline_secrets.yml --secret-file testworkflows/multiline_secrets.secrets.yaml | |
gharun -W testworkflows/multiline_env.yml --env-file testworkflows/multiline_secrets.secrets.yaml | |
cd testworkflows/environment-test | |
gharun -W sample.yml --environment-secret-file prod=prod.secrets --environment-secret-file develop=develop.yml --environment-secret-file staging=staging.yaml --environment-secret-file prod=prod.secrets | |
cd ../.. | |
gharun -W testworkflows/dumpcontexts.yml --list | |
gharun -C testworkflows/case-insensitive-keys-matrix | |
gharun -C testworkflows/matrix-eq-test --parallel 2 | |
${{matrix.image && 'echo "Skipping additional testcases" && exit 0' || ''}} | |
gharun -W testworkflows/cache.yml -P ubuntu-latest=-self-hosted | |
gharun -P ubuntu-latest=-self-hosted -W testworkflows/matrixtest.yml --parallel 1 | |
gharun -W testworkflows/artifact.yml | |
gharun -W testworkflows/issue70/main.yml | |
gharun -W testworkflows/called.yml -e testworkflows/called_workflow_dispatch_event.json --env "input_x=Hello World 2" workflow_dispatch | |
gharun -W testworkflows/called.yml --env "input_x=Hello World" workflow_dispatch | |
gharun --workflow testworkflows/test_template_runs_on.yml --workflow testworkflows/called_template_runs_on.yml | |
gharun --workflow testworkflows/test_template_runs_on2.yml --workflow testworkflows/called_template_runs_on.yml -P self-hosted,testsystem=-self-hosted | |
gharun --workflow testworkflows/test_template_runs_on3.yml --workflow testworkflows/called_template_runs_on.yml -P testsystem2,self-hosted,testsystem=-self-hosted | |
gharun --workflow testworkflows/test_template_runs_on3.yml --workflow testworkflows/called_template_runs_on.yml -P testsystem2,SELF-HOSTED,testsystem=-self-hosted | |
gharun --workflow testworkflows/test_template_runs_on4.yml --workflow testworkflows/called_template_runs_on.yml -P testsystem2,self-hosted,testsystem=-self-hosted | |
gharun --workflow testworkflows/test_template_runs_on4.yml --workflow testworkflows/called_template_runs_on.yml -P Testsystem2,SELF-hosted,TESTSYSTEM=-self-hosted | |
gharun -W testworkflows/skippedjob.yml | |
gharun --workflow testworkflows/test_with_required_secret.yml --workflow testworkflows/called_with_required_secret.yml | |
gharun -W testworkflows/job-continue-on-error.yml | |
gharun -W testworkflows/continue-on-error-bug-3.6.0-4-test.yml | |
gharun -W testworkflows/expect-matrix-error-on-missing-exclude-key.yml && exit 1 || [[ "$?" = "1" ]] | |
cd testworkflows/node16_complex_reusable_workflows | |
gharun | |
cd ../.. | |
cd testworkflows/db-disposed-issue | |
gharun -P ubuntu-latest=-self-hosted | |
gharun -P ubuntu-latest=-self-hosted --parallel 8 | |
cd ../.. | |
gharun -W testworkflows/test-setup-node.yml | |
gharun -C testworkflows/actions_checkout_v1 | |
gharun -C testworkflows/case_insensitive_needs | |
gharun -C testworkflows/inherit_secrets -s misc=topSecretVal | |
gharun -C testworkflows/reusablesCaseInsensitive | |
gharun -C testworkflows/workflow_dispatch workflow_dispatch -i misc=myInput -i si=UdHe -i bval=true -i bval2=false | |
gharun -C testworkflows/workflow_dispatch workflow_dispatch -i Misc=myInput -i SI=UdHe -i bVal=true -i BVAL2=false | |
gharun -C testworkflows/matrix-selector push -j test -m fail:false | |
gharun -C testworkflows/oidc-provider | |
gharun -C testworkflows/reusablesConsistentWorkflowName | |
gharun -C testworkflows/matrix-partial-test | |
gharun -C testworkflows/workflow_ref_and_job_workflow_ref | |
gharun -C testworkflows/reusable-workflows-secrets-inherit-with-required-secrets -s TEST=topsecret -s OPT=testsec | |
gharun -C testworkflows/inherit_vars --var ACTIONS_STEP_DEBUG=true | |
gharun -C testworkflows/actions_artifacts_v4 -s ACTIONS_STEP_DEBUG=true -s ACTIONS_RUNNER_DEBUG=true --runner-version v2.311.0 | |
gharun -C testworkflows/actions_artifacts_v4 -s ACTIONS_STEP_DEBUG=true -s ACTIONS_RUNNER_DEBUG=true | |
gharun -C testworkflows/cache-save-restore-order-tests -s ACTIONS_STEP_DEBUG=true -s ACTIONS_RUNNER_DEBUG=true | |
gharun --event azpipelines -C testworkflows/azpipelines/cross-repo-checkout -W testworkflows/azpipelines/cross-repo-checkout/pipeline.yml --local-repository az/containermatrix@main=testworkflows/azpipelines/containermatrix | |
gharun --event azpipelines -C testworkflows/azpipelines/typedtemplates -W testworkflows/azpipelines/typedtemplates/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/untypedtemplates -W testworkflows/azpipelines/untypedtemplates/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/stagetostagedeps -W testworkflows/azpipelines/stagetostagedeps/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/staticvars -W testworkflows/azpipelines/staticvars/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/staticvarfromcli -W testworkflows/azpipelines/staticvarfromcli/pipeline.yml --var myvar=myval --var myvarwitheq=my=val --env myenvar=myval | |
gharun --event azpipelines -C testworkflows/azpipelines/staticvargroupfromcli -W testworkflows/azpipelines/staticvargroupfromcli/pipeline.yml --environment-var B=myvar=myval --environment-var b=myvarwitheq=my=val --environment-var C=myenvar=myval | |
gharun --event azpipelines -C testworkflows/azpipelines/matrixgenerator -W testworkflows/azpipelines/matrixgenerator/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/matrixjoboutputs -W testworkflows/azpipelines/matrixjoboutputs/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/runoncedeployonlyoutput -W testworkflows/azpipelines/runoncedeployonlyoutput/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/runoncedeployoutput -W testworkflows/azpipelines/runoncedeployoutput/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/cross-repo-template -W testworkflows/azpipelines/cross-repo-template/pipeline.yml --local-repository az/typedtemplates@main=testworkflows/azpipelines/typedtemplates --local-repository az/untypedtemplates@main=testworkflows/azpipelines/untypedtemplates | |
gharun --event azpipelines -C testworkflows/azpipelines/expressions-docs -W testworkflows/azpipelines/expressions-docs --var Build.SourceBranch=refs/heads/main | |
gharun --event azpipelines -C testworkflows/azpipelines/typedtemplates-extends -W testworkflows/azpipelines/typedtemplates-extends/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/version-literal -W testworkflows/azpipelines/version-literal/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/relative-and-absolute-paths -W testworkflows/azpipelines/relative-and-absolute-paths/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/null-each-loop -W testworkflows/azpipelines/null-each-loop/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/cross-repo-relative-paths/repo1 -W testworkflows/azpipelines/cross-repo-relative-paths/repo1/pipeline.yml --local-repository central/shared@main=testworkflows/azpipelines/cross-repo-relative-paths/repo2 | |
gharun --event azpipelines -C testworkflows/azpipelines/extend-variables -W testworkflows/azpipelines/extend-variables/pipeline.yml | |
- name: Windows Container Change Firewall Settings | |
if: contains(matrix.os, 'windows') && !job.container | |
run: | | |
New-NetFirewallRule -Name gharun -DisplayName gharun -Enabled True -Action Allow -Direction Inbound -Program ($env:USERPROFILE + '\.dotnet\tools\gharun.exe') -Protocol tcp | |
Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled False | |
shell: pwsh | |
- name: Test Windows Container | |
if: contains(matrix.os, 'windows') && !job.container | |
run: | | |
set -x | |
gharun -W testworkflows/windows.yml -P windows-latest=mcr.microsoft.com/windows/servercore:${{matrix.tag}} | |
gharun -W testworkflows/testlocalcheckout.yml -P self-hosted=mcr.microsoft.com/windows/servercore:${{matrix.tag}} | |
# depends on bash, therefore disabled for now | |
# gharun -W testworkflows/artifact.yml -P self-hosted=mcr.microsoft.com/windows/servercore:${{matrix.tag}} | |
gharun -W testworkflows/cachewindowscontainer.yml -P windows-latest=mcr.microsoft.com/powershell:lts-windowsservercore-${{matrix.tag}} | |
gharun -W testworkflows/test-setup-node.yml -P self-hosted=mcr.microsoft.com/windows/servercore:${{matrix.tag}} | |
gharun -C testworkflows/windows-container-test1 | |
gharun -C testworkflows/windows-container-test2 | |
gharun -C testworkflows/windows-container-test3-invalid-problem-matcher && exit 1 || [[ "$?" = "1" ]] | |
gharun -C testworkflows/windows-add-path | |
gharun -C testworkflows/windows-add-path -P self-hosted=mcr.microsoft.com/windows/servercore:${{matrix.tag}} | |
gharun --event azpipelines -C testworkflows/azpipelines/windows-container-docs -W testworkflows/azpipelines/windows-container-docs | |
- name: Test Linux Container | |
if: contains(matrix.os, 'ubuntu') && !job.container | |
run: | | |
set -x | |
gharun -W testworkflows/testlocalcheckout.yml -P self-hosted=ubuntu:latest | |
gharun -W testworkflows/artifact.yml -P self-hosted=ubuntu:latest | |
gharun -W testworkflows/cache.yml -P ubuntu-latest=ubuntu:latest | |
gharun -W testworkflows/test-setup-node.yml -P self-hosted=ubuntu:latest | |
gharun -C testworkflows/linux-container-problem-matcher-test1 | |
gharun -C testworkflows/linux-container-i386 | |
gharun --event azpipelines -C testworkflows/azpipelines/containermatrix -W testworkflows/azpipelines/containermatrix/pipeline.yml | |
gharun --event azpipelines -C testworkflows/azpipelines/container-docs -W testworkflows/azpipelines/container-docs | |
shell: bash | |
- name: Test sqlite support | |
if: contains(matrix.os, 'ubuntu') && !job.container | |
run: | | |
mkdir gharun | |
cd gharun | |
unzip ../src/Runner.Client/nupkg/io.github.christopherhx.gharun.${{needs.package.outputs.version}}.nupkg | |
chmod -R +rw tools/ | |
dotnet tools/net6.0/any/Runner.Server.dll --urls http://*:5000 "--ConnectionStrings:sqlite=Data Source=Agents.db;" & | |
sleep 2 | |
echo "Check for creation of sqlite db" | |
stat Agents.db | |
echo "Configure Runner" | |
dotnet tools/net6.0/any/Runner.Listener.dll configure --url http://localhost:5000 --token nothing | |
echo "Start Runner" | |
dotnet tools/net6.0/any/Runner.Listener.dll run& | |
sleep 2 | |
echo "Send job" | |
cd .. | |
set -x | |
gharun --server http://localhost:5000 -W testworkflows/testlocalcheckout.yml | |
gharun --server http://localhost:5000 -W testworkflows/cache.yml -P ubuntu-latest=-self-hosted | |
gharun --server http://localhost:5000 -W testworkflows/testhashfiles.yml | |
gharun --server http://localhost:5000 -W testworkflows/dumpcontexts.yml | |
gharun --server http://localhost:5000 -P ubuntu-latest=-self-hosted -W testworkflows/matrixtest.yml --parallel 1 | |
gharun --server http://localhost:5000 -W testworkflows/artifact.yml | |
shell: bash |