Skip to content

Commit

Permalink
Merge branch 'main' into merge_and_update_bazel_types
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerJang27 authored May 30, 2024
2 parents 9d55d85 + 54c115b commit 6573259
Show file tree
Hide file tree
Showing 233 changed files with 9,483 additions and 9,535 deletions.
102 changes: 0 additions & 102 deletions .eslintrc.yaml

This file was deleted.

16 changes: 15 additions & 1 deletion .github/actions/action_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ runs:
shell: bash
working-directory: ${{ inputs.path }}
env:
JEST_SUITE_NAME: Action Tests
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}

Expand All @@ -64,10 +65,23 @@ runs:
breakpoint-id: trunk-plugins-action-tests
shell: bash
working-directory: ${{ inputs.path }}
trunk-token: ${{ inputs.trunk-token }}
trunk-token: ${{ inputs.trunk-token }}
org: trunk-staging-org
run:
npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --passWithNoTests --ci
env:
JEST_SUITE_NAME: Action Tests
PLUGINS_TEST_CLI_VERSION: ${{ inputs.cli-version }}
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}

- 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-token }}
continue-on-error: true
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
40 changes: 35 additions & 5 deletions .github/actions/linter_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ inputs:
description: Token to login for sourcery test
required: true
trunk-token:
description: CI debugger api token
description: CI debugger api token (org token)
required: true
ref-type:
description: release or main
required: false
default: main

runs:
# TODO(Tyler): See if this can be converted to a js action
Expand All @@ -41,6 +45,13 @@ runs:
- name: Install packages and specify defaults
run: |
echo "CLI_PATH=${{ inputs.cli-path }}" >> "$GITHUB_ENV"
if [[ "${{ inputs.linter-version }}" == "Latest" ]]; then
echo "JEST_LINTER_VERSION=Latest" >> "$GITHUB_ENV"
else
# If the linter version is KnownGoodVersions, coalesce to Snapshots
# For flaky analysis.
echo "JEST_LINTER_VERSION=Snapshots" >> "$GITHUB_ENV"
fi
case "$RUNNER_OS" in
Linux)
Expand All @@ -49,11 +60,11 @@ runs:
sudo rm /var/lib/apt/lists/lock || true
# Install non-hermetic linters
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install libperl-critic-perl perltidy zlib1g-dev software-properties-common
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo apt-get -y install tzdata
sudo add-apt-repository ppa:ondrej/php
sudo apt install -y php8.0-fpm php8.0-xml php8.0-mbstring php8.0-curl
sudo apt install -y php8.2-fpm php8.2-xml php8.2-mbstring php8.2-curl
;;
macOS)
brew install cpm
Expand All @@ -78,6 +89,7 @@ runs:
- name: Clean jest cache
run: npx jest --clearCache
shell: bash
working-directory: ${{ inputs.path }}

- name: Run plugin tests
if: runner.os == 'Windows'
Expand All @@ -90,7 +102,10 @@ runs:
PLUGINS_TEST_CLI_PATH: ${{ env.CLI_PATH }}
SOURCERY_TOKEN: ${{ inputs.sourcery-token }}
# Debug recurrent eslint circular JSON errors
DEBUG: Driver:eslint:*,Driver:cspell:*,Driver:nixpkgs-fmt:*
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: Run plugin tests
if: runner.os != 'Windows'
Expand All @@ -100,7 +115,7 @@ runs:
breakpoint-id: trunk-plugins-linter-tests
shell: bash
working-directory: ${{ inputs.path }}
trunk-token: ${{ inputs.trunk-token }}
trunk-token: ${{ inputs.trunk-token }}
org: trunk-staging-org
run: npm test ${{ inputs.append-args }} ${{ env.PLATFORM_APPEND_ARGS }} --ci --runInBand
env:
Expand All @@ -109,3 +124,18 @@ runs:
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 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-token }}
continue-on-error: true
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
36 changes: 34 additions & 2 deletions .github/actions/tool_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ inputs:
required: false
default: tools --
trunk-token:
description: CI debugger api token
description: CI debugger api token (org token)
required: true
ref-type:
description: release or main
required: false
default: main

runs:
# TODO(Tyler): See if this can be converted to a js action
Expand All @@ -29,11 +33,23 @@ runs:
with:
node-version: 18

- name: Specify defaults
- name: Install packages and specify defaults
run: |
echo "CLI_PATH=${{ inputs.cli-path }}" >> "$GITHUB_ENV"
case "$RUNNER_OS" in
Linux)
# Cleanup any existing apt locks
sudo killall apt-get || true
sudo rm /var/lib/apt/lists/lock || true
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install -y php8.2-fpm php8.2-xml php8.2-mbstring php8.2-curl
;;
macOS)
brew install php gnupg
;;
Windows)
echo "PLATFORM_APPEND_ARGS=--maxWorkers=5" >> "$GITHUB_ENV"
if [[ "${{ inputs.cli-path }}" == "" ]]; then
Expand All @@ -56,6 +72,8 @@ runs:
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: Run plugin tests
if: runner.os != 'Windows'
Expand All @@ -71,3 +89,17 @@ runs:
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 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-token }}
continue-on-error: true
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
5 changes: 3 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ updates:
day: sunday
# trunk-ignore(yamllint/quoted-strings)
time: "08:00" # UTC
labels: [🤖 dependabot]
groups:
dependencies:
patterns:
Expand All @@ -21,9 +20,11 @@ updates:
day: sunday
# trunk-ignore(yamllint/quoted-strings)
time: "08:00" # UTC
labels: [🤖 dependabot]
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@540e7fe497a45ae76370d26d95cc249059c4ac3a # v1.1.12
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@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
# 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@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6

# ℹ️ 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@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
6 changes: 4 additions & 2 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
uses: ./.github/actions/linter_tests
with:
linter-version: ${{ matrix.linter-version }}
ref-type: main
sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }}
trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }}

Expand Down Expand Up @@ -173,13 +174,14 @@ jobs:
with:
linter-version: ${{ matrix.linter-version }}
append-args: linters -- --json --outputFile=${{ matrix.results-file }}-res.json
ref-type: release
sourcery-token: ${{ secrets.TRUNK_SOURCERY_TOKEN }}
trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }}

- name: Upload Test Outputs for Upload Job
# Only upload results from latest. Always run, except when cancelled.
if: (failure() || success()) && matrix.linter-version == 'Latest'
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ matrix.results-file }}-test-results
path: ${{ matrix.results-file }}-res.json
Expand Down Expand Up @@ -238,7 +240,7 @@ jobs:
- name: Upload Test Outputs for Notification Job
# Always run, except when cancelled.
if: (failure() || success())
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: tools-${{ matrix.results-file }}-test-results
path: ${{ matrix.results-file }}-res.json
Expand Down
Loading

0 comments on commit 6573259

Please sign in to comment.