Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions .github/actions/action_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ inputs:
description: Additional args to append to the test invocation
required: false
default: actions/ --
trunk-staging-token:
description: Test analytics staging api token (org token)
required: false
trunk-prod-token:
description: Test analytics prod api token (org token)
required: false
trunk-token:
description: CI debugger api token
required: true

runs:
# TODO(Tyler): See if this can be converted to a js action
Expand Down Expand Up @@ -52,35 +49,39 @@ runs:
working-directory: ${{ inputs.path }}

- name: Run action tests
if: runner.os == 'Windows'
run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --passWithNoTests --ci
shell: bash
working-directory: ${{ inputs.path }}
continue-on-error: true
env:
JEST_SUITE_NAME: Action Tests
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}

- name: Upload prod results
# TODO(Tyler): Add upload on Windows once the action supports it.
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''"
uses: trunk-io/analytics-uploader@main
- name: Run action tests
if: runner.os != 'Windows'
uses: trunk-io/breakpoint@v1.3.0
with:
junit-paths: junit.xml
org-slug: trunk
token: ${{ inputs.trunk-prod-token }}
continue-on-error: true
breakpoint-id: trunk-plugins-action-tests
shell: bash
working-directory: ${{ inputs.path }}
trunk-token: ${{ inputs.trunk-token }}
org: trunk-staging-org
run:
npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --passWithNoTests --ci
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io
JEST_SUITE_NAME: Action Tests
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}

- name: Upload staging results
# TODO(Tyler): Add upload on Windows once the action supports it.
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-staging-token != ''"
- name: Upload results
# TODO(Tyler): Add upload on MacOS/Windows once the action supports it.
if: "!cancelled() && runner.os == 'Linux'"
uses: trunk-io/analytics-uploader@main
with:
junit-paths: junit.xml
org-slug: trunk-staging-org
token: ${{ inputs.trunk-staging-token }}
quarantine: true
token: ${{ inputs.trunk-token }}
continue-on-error: true
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
59 changes: 30 additions & 29 deletions .github/actions/linter_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@
description: Additional args to append to the test invocation
required: false
default: linters --
snyk-token:
description: Token to login for snyk test
required: true
sourcery-token:
description: Token to login for sourcery test
required: true
trunk-staging-token:
description: Test analytics staging api token (org token)
required: false
trunk-prod-token:
description: Test analytics prod api token (org token)
required: false
trunk-token:
description: CI debugger api token (org token)
required: true
ref-type:
description: release or main
required: false
Expand Down Expand Up @@ -73,9 +67,8 @@
sudo apt install -y php8.2-fpm php8.2-xml php8.2-mbstring php8.2-curl
;;
macOS)
brew install powershell/tap/powershell
brew install cpanminus
cpanm YAML::PP Class::Tiny Perl::Critic
brew install cpm
cpm install -g --no-test --color Perl::Critic Perl::Tidy
brew unlink perl && brew link perl
brew install php gnupg
;;
Expand All @@ -99,42 +92,50 @@
working-directory: ${{ inputs.path }}

- name: Run plugin tests
if: runner.os == 'Windows'
run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci
shell: bash
working-directory: ${{ inputs.path }}
continue-on-error: true
env:
PLUGINS_TEST_LINTER_VERSION: ${{ inputs.linter-version }}
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}
SNYK_TOKEN: ${{ inputs.snyk-token }}
SOURCERY_TOKEN: ${{ inputs.sourcery-token }}
# Debug recurrent eslint circular JSON errors
DEBUG: Driver:eslint:*,Driver:nixpkgs-fmt:*,Driver:trunk-toolbox:*
DEBUG: Driver:eslint:*,Driver:nixpkgs-fmt:*
JEST_SUITE_NAME: Linter Tests
JEST_JUNIT_SUITE_NAME:
"{title} ${{ runner.os }} ${{ inputs.ref-type }} ${{ inputs.linter-version }}"

- name: Upload prod results
# TODO(Tyler): Add upload on Windows once the action supports it.
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''"
uses: trunk-io/analytics-uploader@main
- name: Run plugin tests
if: runner.os != 'Windows'
# trunk-ignore(semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha)

Check warning on line 112 in .github/actions/linter_tests/action.yaml

View check run for this annotation

Trunk-Staging.io / Trunk Check

trunk(ignore-disabled-linter)

[new] 'semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha' is a disabled linter
uses: trunk-io/breakpoint@v1.3.0
with:
junit-paths: junit.xml
org-slug: trunk
token: ${{ inputs.trunk-prod-token }}
continue-on-error: true
breakpoint-id: trunk-plugins-linter-tests
shell: bash
working-directory: ${{ inputs.path }}
trunk-token: ${{ inputs.trunk-token }}
org: trunk-staging-org
run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci --runInBand
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io
PLUGINS_TEST_LINTER_VERSION: ${{ inputs.linter-version }}
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}
SOURCERY_TOKEN: ${{ inputs.sourcery-token }}
DEBUG: Driver:nixpkgs-fmt:*, Driver:eslint:*
JEST_SUITE_NAME: Linter Tests
JEST_JUNIT_SUITE_NAME:
"{title} ${{ runner.os }} ${{ inputs.ref-type }} ${{ env.JEST_LINTER_VERSION }}"

- name: Upload staging results
# TODO(Tyler): Add upload on Windows once the action supports it.
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-staging-token != ''"
- name: Upload results
# TODO(Tyler): Add upload on MacOS/Windows once the action supports it.
if: "!cancelled() && runner.os == 'Linux'"
uses: trunk-io/analytics-uploader@main
with:
junit-paths: junit.xml
org-slug: trunk-staging-org
token: ${{ inputs.trunk-staging-token }}
quarantine: true
token: ${{ inputs.trunk-token }}
continue-on-error: true
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
44 changes: 23 additions & 21 deletions .github/actions/tool_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
description: Additional args to append to the test invocation
required: false
default: tools --
trunk-staging-token:
description: Test analytics staging api token (org token)
required: false
trunk-prod-token:
description: Test analytics prod api token (org token)
required: false
trunk-token:
description: CI debugger api token (org token)
required: true
ref-type:
description: release or main
required: false
Expand Down Expand Up @@ -68,36 +65,41 @@
working-directory: ${{ inputs.path }}

- name: Run plugin tests
if: runner.os == 'Windows'
run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci
shell: bash
working-directory: ${{ inputs.path }}
continue-on-error: true
env:
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}
JEST_SUITE_NAME: Tool Tests
JEST_JUNIT_SUITE_NAME: "{title} ${{ runner.os }} ${{ inputs.ref-type }}"

- name: Upload prod results
# TODO(Tyler): Add upload on Windows once the action supports it.
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-prod-token != ''"
uses: trunk-io/analytics-uploader@main
- name: Run plugin tests
if: runner.os != 'Windows'
# trunk-ignore(semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha)

Check warning on line 80 in .github/actions/tool_tests/action.yaml

View check run for this annotation

Trunk-Staging.io / Trunk Check

trunk(ignore-disabled-linter)

[new] 'semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha' is a disabled linter
uses: trunk-io/breakpoint@v1.3.0
with:
junit-paths: junit.xml
org-slug: trunk
token: ${{ inputs.trunk-prod-token }}
continue-on-error: true
breakpoint-id: trunk-plugins-tool-tests
shell: bash
working-directory: ${{ inputs.path }}
trunk-token: ${{ inputs.trunk-token }}
org: trunk-staging-org
run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}
JEST_SUITE_NAME: Tool Tests
JEST_JUNIT_SUITE_NAME: "{title} ${{ runner.os }} ${{ inputs.ref-type }}"

- name: Upload staging results
# TODO(Tyler): Add upload on Windows once the action supports it.
if: "!cancelled() && runner.os != 'Windows' && inputs.trunk-staging-token != ''"
- name: Upload results
# TODO(Tyler): Add upload on MacOS/Windows once the action supports it.
if: "!cancelled() && runner.os == 'Linux'"
uses: trunk-io/analytics-uploader@main
with:
junit-paths: junit.xml
org-slug: trunk-staging-org
token: ${{ inputs.trunk-staging-token }}
quarantine: true
token: ${{ inputs.trunk-token }}
continue-on-error: true
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
11 changes: 7 additions & 4 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ updates:
schedule:
interval: weekly
day: sunday
time: "10:00" # UTC
# trunk-ignore(yamllint/quoted-strings)
time: "08:00" # UTC
groups:
dependencies:
patterns:
Expand All @@ -17,11 +18,13 @@ updates:
schedule:
interval: weekly
day: sunday
time: "10:00" # UTC
ignore:
- dependency-name: eslint
# trunk-ignore(yamllint/quoted-strings)
time: "08:00" # UTC
groups:
dependencies:
patterns:
- "*"
# TODO(Tyler): Readd once eslint9 is resolved.
ignore:
- dependency-name: eslint
open-pull-requests-limit: 2
2 changes: 1 addition & 1 deletion .github/workflows/annotate_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Trunk Check
uses: trunk-io/trunk-action@4d5ecc89b2691705fd08c747c78652d2fc806a94 # v1.1.19
uses: trunk-io/trunk-action@f6c5f1b90503c30e02059667dbc247f2257b63c5 # v1.1.15
with:
post-annotations: true
# This job may fail when the PR was not run on a fork, and that's okay
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
# Override language selection by uncommenting this and choosing your languages
with:
languages: javascript

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/autobuild@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -56,4 +56,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
Loading
Loading