Skip to content

Commit

Permalink
Merge branch 'main' into test-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Natoandro committed Nov 25, 2024
2 parents 9f2c050 + 9671d60 commit 57d7ea6
Show file tree
Hide file tree
Showing 749 changed files with 10,334 additions and 11,786 deletions.
722 changes: 274 additions & 448 deletions .ghjk/lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .github/workflows/autoupdate.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: pre-commit auto-updater
on:
schedule:
- cron: "0 2 1 * *"
Expand All @@ -10,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: browniebroke/pre-commit-autoupdate-action@main
- uses: peter-evans/create-pull-request@v6
- uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-hooks
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: nightly docker builds
on:
schedule:
- cron: "0 2 * * *"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: pr title check
run-name: checking pr title for ${{ github.event.pull_request.title || github.ref }}
on:
pull_request_target:
types:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-website.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: publish website
run-name: publish website jobs for ${{ github.ref }}
on:
push:
branches:
Expand Down
52 changes: 7 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: release jobs
run-name: release jobs for ${{ github.ref }}
on:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -287,49 +289,6 @@ jobs:
docker buildx imagetools create --tag ${{ env.REGISTRY_IMAGE }}:${{ steps.latest-tag.outputs.tag }} --tag ${{ env.REGISTRY_IMAGE }}:latest $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:latest
pub-vscode-extension:
needs:
- check-bump
if: |
always()
&& (
needs.check-bump.result == 'success'
|| github.event_name == 'workflow_dispatch'
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: WyriHaximus/[email protected]
id: latest-tag
- uses: metatypedev/setup-ghjk@318209a9d215f70716a4ac89dbeb9653a2deb8bc
- shell: bash
run: |
cd src/meta-lsp
pnpm install --frozen-lockfile
cd ts-language-server
pnpm install --frozen-lockfile
cd ../vscode-metatype-support
pnpm install --frozen-lockfile
cd ..
pnpm compile:ts-server
pnpm compile:vscode
pnpm vscode:package
# avoid publishing pre-release versions as they don't
# support it
[[ "$(ghjk x version-print)" != *-* ]] \
&& ([ ${{ github.event_name == 'workflow_dispatch' && inputs.ovewriteArtifacts }} == 'true' ] \
&& pnpm run vscode:publish -p ${{ secrets.AZURE_DEVOPS_TOKEN }} --skip-duplicate \
|| pnpm run vscode:publish -p ${{ secrets.AZURE_DEVOPS_TOKEN }})
- uses: svenstaro/upload-release-action@v2
with:
tag: ${{ steps.latest-tag.outputs.tag }}
file: "src/meta-lsp/*.vsix"
file_glob: true
overwrite: ${{ inputs.ovewriteArtifacts }}

bump:
needs:
- pub-meta-cli
Expand All @@ -352,7 +311,10 @@ jobs:
ghjk x version-bump prerelease
echo "version=$(ghjk x version-print)" >> $GITHUB_OUTPUT
git cliff --output CHANGELOG.md
- uses: peter-evans/create-pull-request@v6
# exclude .ghjk from the changeset to avoid modifying
# the lockfile
git checkout -- .ghjk
- uses: peter-evans/create-pull-request@v7
with:
branch: bump-${{ steps.bump.outputs.version }}
delete-branch: true
Expand All @@ -364,4 +326,4 @@ jobs:
# on them, we create it as a draft PR
# the actions will then run when it's readied for review
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
draft: always-true
draft: "always-true"
36 changes: 10 additions & 26 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Test Suite
run-name: Test Suite for ${{ github.ref }}
name: test suite
run-name: test suite for ${{ github.event.pull_request.title || github.ref }}
on:
workflow_dispatch:
inputs:
debug_enabled:
tmate_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
description: |
Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate).
This disables all but the test-full jobs.
required: false
default: false
push:
Expand Down Expand Up @@ -92,7 +94,6 @@ jobs:
ghjk x install-ts
ghjk x install-website
ghjk x install-lsp
ghjk x fetch-deno
# pre-resolve everything to disable resolutions
Expand All @@ -102,7 +103,7 @@ jobs:
lint-compat:
needs: changes
if: ${{ needs.changes.outputs.full == 'true' }}
if: ${{ needs.changes.outputs.full == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.tmate_enabled) }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
Expand Down Expand Up @@ -147,7 +148,7 @@ jobs:
test-website:
needs: changes
if: ${{ needs.changes.outputs.website == 'true' }}
if: ${{ needs.changes.outputs.website == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.tmate_enabled) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -172,7 +173,7 @@ jobs:
bulid-docker:
needs: changes
if: ${{ needs.changes.outputs.typegate == 'true' }}
if: ${{ needs.changes.outputs.typegate == 'true' && !(github.event_name == 'workflow_dispatch' && inputs.tmate_enabled) }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -235,7 +236,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.tmate_enabled }}
uses: mxschmitt/action-tmate@v3
with:
detached: true
Expand Down Expand Up @@ -318,20 +319,3 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.lcov
fail_ci_if_error: true

test-lsp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: metatypedev/setup-ghjk@318209a9d215f70716a4ac89dbeb9653a2deb8bc
- shell: bash
run: |
ghjk x install-lsp
ghjk x test-lsp
# node --test --import=tsx --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=coverage.lcov tests/*.test.ts
# - uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./meta-lsp/ts-language-server/coverage.lcov
# fail_ci_if_error: true
82 changes: 25 additions & 57 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,35 @@ repos:
- id: deno-fmt
name: Deno format
language: system
entry: bash -c 'cd typegate && deno fmt --ignore=native,src/typegraphs,tmp,tests/e2e/nextjs,tests/metagen/typegraphs/sample/ts/client.ts && cd ../dev && deno fmt && cd ../typegraph/deno && deno fmt --ignore=node_modules,dist && cd ../../libs/metagen/src && deno fmt'
entry: bash -c 'deno fmt'
pass_filenames: false
types:
- javascript
- ts
files: ^(typegate|dev|typegraph/deno)/
- tsx
- json
- yaml
- id: deno-lint
name: Deno lint
language: system
entry: bash -c 'cd typegate && deno lint --rules-exclude=no-explicit-any --ignore=native,tmp,tests/e2e/nextjs && cd ../dev && deno lint && cd ../libs/metagen/src/ && deno lint'
entry: bash -c 'deno lint && ghjk x lint-deno'
pass_filenames: false
types:
- javascript
- ts
files: ^(typegate|dev)/
- tsx
- json
- yaml
files: ^(src/typegate|tools)/
- id: es-lint
name: Eslint website
language: system
entry: bash -c 'cd website && [ -f node_modules/.bin/eslint ] && pnpm lint && pnpm prettier'
entry: bash -c 'cd ./docs/metatype.dev/ && [ -f node_modules/.bin/eslint ] && pnpm lint && pnpm prettier'
pass_filenames: false
types_or:
- ts
- tsx
files: ^website/
exclude: ^website/typegraphs/
- id: devtools-lint
name: ESLint meta-lsp
language: system
entry: bash -c 'cd meta-lsp && pnpm lint'
pass_filenames: false
types:
- ts
files: ^meta-lsp/
files: ^docs/metatype.dev
#- id: cargo-udeps
# name: Check for unused cargo dependencies
# language: system
Expand Down Expand Up @@ -87,9 +85,9 @@ repos:
.*deno.lock|
CHANGELOG.md|
.*\.snap$|
typegate/src/typegraphs/.*\.json|
website/docs/reference/|
libs/pyrt_wit_wire/pyrt|
src/typegate/src/typegraphs/.*\.json|
docs/metatype.dev/reference/|
src/pyrt_wit_wire/pyrt|
migration_lock.toml|
tests/metagen/typegraphs/sample/[rs|ts|py]/client\.[rs|ts|py]
)
Expand All @@ -100,66 +98,36 @@ repos:
name: "License MPL-2.0 python"
args:
#- --remove-header
- --license-filepath=dev/license-header-MPL-2.0.txt
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=#"
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- python
files: ^typegraph/
- id: insert-license
name: "License Elastic-2.0 rust"
args:
#- --remove-header
- --license-filepath=dev/license-header-Elastic-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
- "--skip-license-insertion-comment=@generated"
types_or:
- rust
files: ^(typegate|libs!(/metagen/.*))/
- python
exclude: ^examples/|src/metagen/src/.*/static/.*
- id: insert-license
name: "License MPL-2.0 rust"
args:
#- --remove-header
- --license-filepath=dev/license-header-MPL-2.0.txt
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
- "--skip-license-insertion-comment=@generated"
types_or:
- rust
files: ^(meta-cli|typegraph|libs/metagen)/
exclude: ^examples/|src/metagen/src/.*/static/.*
- id: insert-license
name: "License Elastic-2.0 deno"
name: "License MPL-2.0 typescript"
args:
#- --remove-header
- --license-filepath=dev/license-header-Elastic-2.0.txt
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
- "--skip-license-insertion-comment=@generated"
types_or:
- ts
files: ^(typegate|dev)/
- id: insert-license
name: "License MPL-2.0 deno"
args:
#- --remove-header
- --license-filepath=dev/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- ts
files: ^typegraph/
- id: insert-license
name: "License Elastic-2.0 typescript"
args:
#- --remove-header
- --license-filepath=dev/license-header-Elastic-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- ts
- tsx
files: ^website/
exclude: website/typegraphs
exclude: ^examples/|src/metagen/src/.*/static/.*
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
hooks:
Expand Down
34 changes: 17 additions & 17 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"recommendations": [
"charliermarsh.ruff",
"rust-lang.rust-analyzer",
"ms-python.black-formatter",
"denoland.vscode-deno",
"ms-vscode-remote.remote-containers",
"dbaeumer.vscode-eslint",
"graphql.vscode-graphql-syntax",
"unifiedjs.vscode-mdx",
"ms-python.vscode-pylance",
"ms-python.python",
"chrischinchilla.vale-vscode",
"hediet.vscode-drawio",
"davidlday.languagetool-linter",
"dtsvet.vscode-wasm",
"bierner.comment-tagged-templates"
]
"recommendations": [
"charliermarsh.ruff",
"rust-lang.rust-analyzer",
"ms-python.black-formatter",
"denoland.vscode-deno",
"ms-vscode-remote.remote-containers",
"dbaeumer.vscode-eslint",
"graphql.vscode-graphql-syntax",
"unifiedjs.vscode-mdx",
"ms-python.vscode-pylance",
"ms-python.python",
"chrischinchilla.vale-vscode",
"hediet.vscode-drawio",
"davidlday.languagetool-linter",
"dtsvet.vscode-wasm",
"bierner.comment-tagged-templates"
]
}
Loading

0 comments on commit 57d7ea6

Please sign in to comment.