Skip to content

Implement infinite cycle detection in PineVM with regression tests #5138

Implement infinite cycle detection in PineVM with regression tests

Implement infinite cycle detection in PineVM with regression tests #5138

name: test-and-publish
on:
push:
workflow_dispatch:
pull_request_review:
types: [submitted]
jobs:
build:
strategy:
fail-fast: false
matrix:
environment: [ubuntu-24.04, windows-2022, macos-14]
isManualRun:
- ${{ github.event_name == 'workflow_dispatch' }}
include:
- environment: ubuntu-24.04
publish-runtime-id: linux-x64
- environment: windows-2022
publish-runtime-id: win-x64
- environment: macos-14
publish-runtime-id: osx-x64
# Exclude macOS on automatic triggers (push/PR). On manual workflow_dispatch, all environments run.
exclude:
- isManualRun: false
environment: macos-14
runs-on: ${{ matrix.environment }}
steps:
- name: Avoid git mutating files on checkout
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Check installed dotnet
run: dotnet --info
- name: Clean package cache as a temporary workaround for https://github.com/actions/setup-dotnet/issues/155
run: |
dotnet clean ./implement/Pine.Core.Tests/Pine.Core.Tests.csproj && dotnet nuget locals all --clear
dotnet clean ./implement/Pine.IntegrationTests/Pine.IntegrationTests.csproj && dotnet nuget locals all --clear
- name: Check formatting in .NET source code
run: |
dotnet format ./implement/Pine.Core --verify-no-changes --verbosity detailed
dotnet format ./implement/Pine.Core.Tests --verify-no-changes --verbosity detailed
dotnet format ./implement/pine --verify-no-changes --verbosity detailed
dotnet format ./implement/Pine.IntegrationTests --verify-no-changes --verbosity detailed
dotnet format ./implement/prebuild --verify-no-changes --verbosity detailed
- name: Prebuild
working-directory: ./implement/
run: |
dotnet run --project ./prebuild/prebuild.csproj --configuration Release
- name: Run Pine Core tests
run: |
dotnet run --project=./implement/Pine.Core.Tests/Pine.Core.Tests.csproj -- --report-xunit-trx --diagnostic
- name: Run integration tests
run: |
dotnet run --project=./implement/Pine.IntegrationTests/Pine.IntegrationTests.csproj -- --report-xunit-trx --diagnostic
- name: Publish test results
uses: actions/upload-artifact@v5
if: always()
with:
name: test-results-${{ github.sha }}-${{ matrix.environment }}
# path: ./implement/Pine.IntegrationTests/TestResults
path: ./implement/**/TestResults
- name: Compile Overview of Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
if: always()
with:
check_name: "Test Results Overview ${{ matrix.environment }}"
files: |
./implement/**/TestResults/**/*.xml
./implement/**/TestResults/**/*.trx
./implement/**/TestResults/**/*.json
- name: dotnet publish Pine
run: dotnet publish -c Debug -r ${{ matrix.publish-runtime-id }} --self-contained true -p:PublishSingleFile=true --output ./dotnet-build ./implement/pine
- name: Copy artifacts to publish
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path "./publish";
Get-ChildItem -Path "./dotnet-build/" -Filter "pine*" | ForEach-Object { Copy-Item -Path $_.FullName -Destination "./publish/" }
- name: Publish artifacts
uses: actions/upload-artifact@v5
with:
name: pine-bin-${{ github.sha }}-${{ matrix.publish-runtime-id }}
path: ./publish
- name: dotnet publish with separate assemblies
run: dotnet publish -c Debug ./implement/pine --output ./publish-separate-assemblies
- name: Publish artifacts with separate assemblies
uses: actions/upload-artifact@v5
with:
name: pine-separate-assemblies-${{ github.sha }}-${{ matrix.publish-runtime-id }}
path: ./publish-separate-assemblies
- name: self-test
run: ./publish/pine self-test
- name: Elm App Compiler - Run tests with pine elm-test-rs
# Adapt to elm-test-rs crashing on macOS
# elm-test-rs also wrote the following before crashing:
# elm: security: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
# if: ${{ !contains( matrix.environment, 'macos') }}
# run: ./publish/pine elm-test-rs ./implement/pine/Elm/elm-compiler
# TODO: Adapt test command to work with dependency on Pine_kernel functions
run: echo "Skipping elm-test because of unresolved dependencies on Pine_kernel functions"
- name: dotnet build-server shutdown
run: dotnet build-server shutdown