From 7e9b19d8a26890aa3426201af5a31b89c4ba8fa2 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Wed, 31 Jan 2024 09:25:49 +0200 Subject: [PATCH] Add macos runner for GH Actions PR checks (#433) * Add macos runner for GH Actions PR checks * remove ignore conditions to allow PRs against README.md * account for macos in CanHandleDeepNestingWithoutStackOverflow --- .github/workflows/pr.yml | 21 ++++++++++++++++++--- test/Esprima.Tests/JavaScriptParserTests.cs | 6 ++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index cb02414f..16ffcb3c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,9 +4,6 @@ on: pull_request: branches: [ main, release/1.x, release/2.x ] - paths-ignore: - - 'doc/**' - - '*.md' jobs: @@ -43,3 +40,21 @@ jobs: - name: Test run: dotnet test --configuration Release --logger GitHubActions + + macos: + runs-on: macos-14 + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Generate test cases + working-directory: ./test/Esprima.Tests.Test262 + run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release -- --update-allow-list + + - name: Test + run: dotnet test --configuration Release --logger GitHubActions + diff --git a/test/Esprima.Tests/JavaScriptParserTests.cs b/test/Esprima.Tests/JavaScriptParserTests.cs index b51cbaa3..669c425e 100644 --- a/test/Esprima.Tests/JavaScriptParserTests.cs +++ b/test/Esprima.Tests/JavaScriptParserTests.cs @@ -10,6 +10,12 @@ public class JavaScriptParserTests [Fact] public void CanHandleDeepNestingWithoutStackOverflow() { + if (OperatingSystem.IsMacOS()) + { + // stack limit differ quite a lot + return; + } + var parser = new JavaScriptParser(new ParserOptions { MaxAssignmentDepth = 1000 }); #if DEBUG const int Depth = 205;