diff --git a/.github/workflows/bazel.yaml b/.github/workflows/bazel.yaml index 4854901e1..67d6586c5 100644 --- a/.github/workflows/bazel.yaml +++ b/.github/workflows/bazel.yaml @@ -30,4 +30,4 @@ jobs: cli-version: 0.10.0-beta.3 bazel-bep-path: build_events.json org-slug: trunk - token: ${{ secrets.TRUNK_TOKEN }} \ No newline at end of file + token: ${{ secrets.TRUNK_TOKEN }} diff --git a/.github/workflows/csharp-tests.yaml b/.github/workflows/csharp-tests.yaml index 759064689..7d617a0e7 100644 --- a/.github/workflows/csharp-tests.yaml +++ b/.github/workflows/csharp-tests.yaml @@ -2,53 +2,53 @@ name: C# Tests on: push: - branches: [ main ] + branches: [main] paths: - - 'csharp/**' + - "csharp/**" pull_request: - branches: [ main ] + branches: [main] paths: - - 'csharp/**' + - "csharp/**" jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '8.0.x' # Updated to .NET 8 - - - name: Restore dependencies - run: dotnet restore csharp/ItsAlwaysSunnyOnEarth.sln - - - name: Build - run: dotnet build csharp/ItsAlwaysSunnyOnEarth.sln --no-restore --configuration Release - - - name: Test - run: dotnet test csharp/ItsAlwaysSunnyOnEarth.Tests/ItsAlwaysSunnyOnEarth.Tests.csproj --no-build --configuration Release --logger "junit;LogFilePath=test-results/csharp-junit.xml;MethodFormat=Class;FailureBodyFormat=Verbose" - - - name: Upload results to Trunk - if: ${{ always() }} - uses: trunk-io/analytics-uploader@main - with: - cli-version: 0.10.0-beta.3 - # Path to your test results. - # This path should match the LogFilePath used in the dotnet test command. - junit-paths: "**/csharp-junit.xml" - # Provide your Trunk organization slug. - org-slug: trunk - # Provide your Trunk API token as a GitHub secret. - token: ${{ secrets.TRUNK_TOKEN }} - continue-on-error: true - - - name: Upload test results - if: always() # Always run this step to upload results - uses: actions/upload-artifact@v4 - with: - name: csharp-test-results - path: 'test-results/csharp-junit.xml' + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" # Updated to .NET 8 + + - name: Restore dependencies + run: dotnet restore csharp/ItsAlwaysSunnyOnEarth.sln + + - name: Build + run: dotnet build csharp/ItsAlwaysSunnyOnEarth.sln --no-restore --configuration Release + + - name: Test + run: dotnet test csharp/ItsAlwaysSunnyOnEarth.Tests/ItsAlwaysSunnyOnEarth.Tests.csproj --no-build --configuration Release --logger "junit;LogFilePath=test-results/csharp-junit.xml;MethodFormat=Class;FailureBodyFormat=Verbose" + + - name: Upload results to Trunk + if: ${{ always() }} + uses: trunk-io/analytics-uploader@main + with: + cli-version: 0.10.0-beta.3 + # Path to your test results. + # This path should match the LogFilePath used in the dotnet test command. + junit-paths: "**/csharp-junit.xml" + # Provide your Trunk organization slug. + org-slug: trunk + # Provide your Trunk API token as a GitHub secret. + token: ${{ secrets.TRUNK_TOKEN }} + continue-on-error: true + + - name: Upload test results + if: always() # Always run this step to upload results + uses: actions/upload-artifact@v4 + with: + name: csharp-test-results + path: "test-results/csharp-junit.xml" diff --git a/.github/workflows/javascript-tests.yaml b/.github/workflows/javascript-tests.yaml index d64453e99..f27edcb98 100644 --- a/.github/workflows/javascript-tests.yaml +++ b/.github/workflows/javascript-tests.yaml @@ -25,13 +25,13 @@ jobs: run: | pnpm install sudo npx playwright install-deps - npx playwright install + npx playwright install - name: Run Mocha Tests if: ${{ always() }} run: | npm run mocha-test || true - cat javascript/tests/mocha/mocha_test.xml + cat javascript/tests/mocha/mocha_test.xml - name: Run Jest Tests if: ${{ always() }} diff --git a/.github/workflows/pull_request_factory.yaml b/.github/workflows/pull_request_factory.yaml index 1469939b8..12ddca17f 100644 --- a/.github/workflows/pull_request_factory.yaml +++ b/.github/workflows/pull_request_factory.yaml @@ -7,7 +7,7 @@ on: jobs: merge-pr: - runs-on: [ubuntu-latest] + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 @@ -25,7 +25,7 @@ jobs: create-pr: needs: merge-pr - runs-on: [ubuntu-latest] + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/retry-tests.yaml b/.github/workflows/retry-tests.yaml index 871e5c095..560aaedd0 100644 --- a/.github/workflows/retry-tests.yaml +++ b/.github/workflows/retry-tests.yaml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.x @@ -65,8 +65,7 @@ jobs: retention-days: 5 - name: trigger job re-run - if: - ${{ failure() && steps.test.conclusion == 'failure' && fromJSON(github.run_attempt) < 5}} + if: ${{ failure() && steps.test.conclusion == 'failure' && fromJSON(github.run_attempt) < 5}} env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/ruby-tests.yaml b/.github/workflows/ruby-tests.yaml index 9149bf59e..a815b4bc1 100644 --- a/.github/workflows/ruby-tests.yaml +++ b/.github/workflows/ruby-tests.yaml @@ -3,7 +3,11 @@ name: Ruby Tests on: schedule: - cron: 0 */6 * * * - pull_request: {} + pull_request: + types: [opened, synchronize, reopened] + push: + branches: [ main, master ] + workflow_dispatch: jobs: test: diff --git a/.github/workflows/trunk_check.yaml b/.github/workflows/trunk_check.yaml index 437827fe9..24924d69f 100644 --- a/.github/workflows/trunk_check.yaml +++ b/.github/workflows/trunk_check.yaml @@ -1,12 +1,13 @@ name: Trunk Check on: - pull_request: + push: {} permissions: contents: read # Required for Trunk to post annotations checks: write + pull-requests: read jobs: trunk_check: @@ -23,5 +24,6 @@ jobs: cache: false timeout-seconds: 1500 # 25 minutes in seconds cat-trunk-debug-logs: true - github-token: ${{ github.token }} - debug: true + arguments: --log-level=debug + check-all-mode: "hold-the-line" + continue-on-error: true \ No newline at end of file diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 2a6ea2f2e..02ca64c4b 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -2,7 +2,7 @@ # To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml version: 0.1 cli: - version: 1.24.1-beta.3 + version: 1.24.1-beta.4 shell_hooks: enforce: true diff --git a/eslint.config.js b/eslint.config.js index 234518132..dadf3de18 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -3,6 +3,7 @@ export default [ rules: { semi: "error", "prefer-const": "error", + "no-unused-vars": "error", }, }, ]; diff --git a/javascript/src/season.js b/javascript/src/season.js index 22cdc9fe1..0680b2402 100644 --- a/javascript/src/season.js +++ b/javascript/src/season.js @@ -4,7 +4,12 @@ const Animal = { }; class Season { - getCurrent() { + getOther() { + const unusedVariable = "This will trigger a linting error"; + return "other"; + } + + getCurrent() { return Animal.Rabbit; } }