Skip to content
Merged
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
15 changes: 4 additions & 11 deletions .github/workflows/action-check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,42 @@
# check and fail if the checked-in `dist/` directory does not match what is
# expected from the build.
name: Check Transpiled JavaScript

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
check-dist:
name: Check dist/
runs-on: ${{ vars.RUNNER }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6

- name: Setup Node.js
id: setup-node
uses: ubicloud/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Remove dist/ Directory
id: remove-dist
run: npx rimraf ./dist

- name: Install Dependencies
id: install
run: npm ci

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Build dist/ Directory
id: build
run: npm run bundle && npm run schema

# This will fail the workflow if the `dist/` directory is different than
# expected.
- name: Compare Directories
Expand All @@ -64,15 +59,13 @@ jobs:
git diff --ignore-space-at-eol --text dist/
exit 1
fi

- name: Check schema
id: check-schema
run: |
if [ "$(git diff --ignore-space-at-eol --text schema/ | wc -l)" -gt "0" ]; then
echo "Detected schema changes" >> /dev/stderr
exit 1
fi

# If `dist/` was different than expected, upload the expected version as a
# workflow artifact.
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/action-ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,33 @@
name: test

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
test-typescript:
name: TypeScript Tests
runs-on: ${{ vars.RUNNER }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6

- name: Setup Node.js
id: setup-node
uses: ubicloud/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: npm-ci
run: npm ci

- name: Check Format
id: npm-format-check
run: npm run format:check

- name: Lint
id: npm-lint
run: npm run lint

- name: Test
id: npm-ci-test
run: npm run ci-test

test-action:
name: Actions Test / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -66,11 +50,9 @@ jobs:
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Setup yq
if: steps.check-yq.outputs.exists == 'false'
uses: carteramesh/ci/.github/actions/install-yq@main

- name: Merge YAML configs
shell: bash
run: |
Expand All @@ -85,7 +67,6 @@ jobs:
with:
config: merged.json
runner: ${{ matrix.os }}

- name: Print Output
id: output
shell: bash
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/action-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,33 @@ on:
push:
branches:
- main

permissions:
contents: read
packages: read

jobs:
lint:
continue-on-error: true
name: Lint Codebase
runs-on: ${{ vars.RUNNER }}

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Node.js
id: setup-node
uses: ubicloud/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: install
run: npm ci

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Lint Codebase
id: super-linter
run: npm run format:check && npm run lint
4 changes: 4 additions & 0 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
uses: carteramesh/ci/.github/actions/rust-init@main
with:
packages: ${{ toJSON(fromJSON(needs.config.outputs.config).global.packages) }}
- name: Validate ANTROPIC_API_KEY
shell: bash
run: |
[ -z "${{ secrets.ANTROPIC_API_KEY }}" ] && exit 1
- name: jobtaker
if: ${{ fromJSON(needs.config.outputs.config).ai.enabled }}
uses: anthropics/claude-code-action@v1
Expand Down
5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

16 changes: 0 additions & 16 deletions .prettierrc.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .yaml-lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { jest } from '@jest/globals';
import * as core from '../__fixtures__/core.js';
import * as fs from 'fs';
import * as fs from 'node:fs';
import * as yaml from 'js-yaml';
// Mocks should be declared before the module being tested is imported.
jest.unstable_mockModule('@actions/core', () => core);
Expand Down
108 changes: 108 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
"json": {
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
}
},
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": ["**", "!dist/*", "!coverage/"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"formatWithErrors": true,
"indentWidth": 2
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noConstantMathMinMaxClamp": "error",
"noUndeclaredVariables": "error",
"noUnusedImports": "error",
"noUnusedFunctionParameters": "error",
"noUnusedPrivateClassMembers": "error",
"useExhaustiveDependencies": {
"level": "error",
"options": {
"reportUnnecessaryDependencies": false
}
},
"noUnusedVariables": "error"
},
"style": {
"noParameterProperties": "error",
"noYodaExpression": "error",
"useConsistentBuiltinInstantiation": "error",
"useFragmentSyntax": "error",
"useShorthandAssign": "error",
"noNonNullAssertion": "off",
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error",
"useArrayLiterals": "error"
},
"suspicious": {
"useAwait": "off",
"noEvolvingTypes": "off",
"noExplicitAny": "off"
},
"complexity": {
"noUselessStringConcat": "error",
"noUselessUndefinedInitialization": "error",
"noVoid": "error",
"useDateNow": "error",
"noBannedTypes": "off",
"noForEach": "off",
"useOptionalChain": "off",
"useLiteralKeys": "off"
},
"performance": {
"noAccumulatingSpread": "off"
}
}
},
"javascript": {
"globals": ["Bun"],
"formatter": {
"arrowParentheses": "always",
"quoteStyle": "single",
"bracketSameLine": false,
"semicolons": "always",
"bracketSpacing": true,
"trailingCommas": "all",
"quoteProperties": "asNeeded",
"enabled": true,
"attributePosition": "auto",
"indentWidth": 2,
"indentStyle": "space",
"jsxQuoteStyle": "double",
"lineEnding": "lf",
"lineWidth": 120
}
}
}
Loading
Loading