From 6d9480964bd1d2ed96f77c7211431987442676aa Mon Sep 17 00:00:00 2001 From: Ken Domino Date: Sun, 17 Nov 2024 14:19:29 -0500 Subject: [PATCH] [build] Fix for #4326 -- GitHub Action VMs running MacOS are unreliable. (#4327) * Fix for #4326 * Try again. --- .github/workflows/main.yml | 10 ++++++++-- _scripts/test.ps1 | 36 +++++++++++++++++++----------------- bnf/README.md | 3 +++ 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a22c8d50c8..f0fb8503d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -117,7 +117,7 @@ jobs: - name: Upgrade Pip. run: | python -m ensurepip --upgrade - - name: Test Pip. + - name: Test Pip run: | pip --version - name: Install Antlr tool @@ -162,7 +162,13 @@ jobs: $Before = "${{ github.event.before }}" $After = "${{ github.event.after }}" } - _scripts/test.ps1 -target ${{ matrix.language }} -pc "$Before" -cc "$After" + if ("${{ matrix.os }}" -eq "ubuntu-latest") { + _scripts/test.ps1 -target ${{ matrix.language }} -pc "$Before" -cc "$After" + } elseif ("${{ matrix.os }}" -eq "windows-latest") { + _scripts/test.ps1 -target ${{ matrix.language }} -pc "$Before" -cc "$After" + } elseif ("${{ matrix.os }}" -eq "macos-latest") { + _scripts/test.ps1 -target ${{ matrix.language }} -pc "$Before" -cc "$After" -buildonly:1 + } static-check: runs-on: ${{ matrix.os }} diff --git a/_scripts/test.ps1 b/_scripts/test.ps1 index 8902a4a41f..4aeacc2e54 100644 --- a/_scripts/test.ps1 +++ b/_scripts/test.ps1 @@ -1,7 +1,8 @@ param ( [string]$target='CSharp', [string]$pc, - [string]$cc + [string]$cc, + [bool]$buildonly=$false ) function Get-GrammarSkip { @@ -123,22 +124,23 @@ function Test-Grammar { } # test - $start2 = Get-Date - Write-Host "--- Testing files ---" -$workingDirectory = Get-Location -Write-Host "The pwd is $workingDirectory" - ./test.ps1 - $passed = $LASTEXITCODE -eq 0 - - if (! $passed) { - $success = $false - $failStage = [FailStage]::Test - Write-Host "Test completed, time: $((Get-Date) - $start2)" -ForegroundColor Yellow - Set-Location $cwd - return @{ - Success = $success - Stage = $failStage - FailedCases = $failedList + if (! $buildonly) { + $start2 = Get-Date + Write-Host "--- Testing files ---" + $workingDirectory = Get-Location + Write-Host "The pwd is $workingDirectory" + ./test.ps1 + $passed = $LASTEXITCODE -eq 0 + if (! $passed) { + $success = $false + $failStage = [FailStage]::Test + Write-Host "Test completed, time: $((Get-Date) - $start2)" -ForegroundColor Yellow + Set-Location $cwd + return @{ + Success = $success + Stage = $failStage + FailedCases = $failedList + } } } } diff --git a/bnf/README.md b/bnf/README.md index 0a4dd6403f..6c02836e6b 100644 --- a/bnf/README.md +++ b/bnf/README.md @@ -16,3 +16,6 @@ https://dl.acm.org/doi/pdf/10.1145/366193.366201 https://www.softwarepreservation.org/projects/ALGOL/paper/Backus-Syntax_and_Semantics_of_Proposed_IAL.pdf https://dl.acm.org/doi/pdf/10.1145/355588.365140 + +### Issues +* Grammar is ambiguous.