-
Notifications
You must be signed in to change notification settings - Fork 17
refactor: use hosted tool cache installer #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
21e28f3
191683a
58eef49
897dac3
4f672ff
4b28bcd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| // This is based on the reusable configuration from | ||
| // https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. | ||
| const js = require('@eslint/js'); | ||
| const tsParser = require('@typescript-eslint/parser'); | ||
| const tsPlugin = require('@typescript-eslint/eslint-plugin'); | ||
| const nodePlugin = require('eslint-plugin-n').default; | ||
| const jestPlugin = require('eslint-plugin-jest'); | ||
| const prettierConfig = require('eslint-config-prettier'); | ||
|
|
||
| module.exports = [ | ||
| { | ||
| ignores: ['coverage/**', 'dist/**', 'lib/**', 'node_modules/**'] | ||
| }, | ||
| js.configs.recommended, | ||
| { | ||
| files: ['**/*.ts'], | ||
| languageOptions: { | ||
| parser: tsParser, | ||
| parserOptions: { | ||
| sourceType: 'module' | ||
| }, | ||
| globals: { | ||
| Buffer: 'readonly', | ||
| NodeJS: 'readonly', | ||
| process: 'readonly' | ||
| } | ||
| }, | ||
| plugins: { | ||
| '@typescript-eslint': tsPlugin, | ||
| n: nodePlugin, | ||
| jest: jestPlugin | ||
| }, | ||
| rules: { | ||
| ...tsPlugin.configs.recommended.rules, | ||
| '@typescript-eslint/no-require-imports': 'error', | ||
| '@typescript-eslint/no-non-null-assertion': 'off', | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/no-empty-function': 'off', | ||
| '@typescript-eslint/ban-ts-comment': [ | ||
| 'error', | ||
| { | ||
| 'ts-ignore': 'allow-with-description' | ||
| } | ||
| ], | ||
| 'no-console': 'error', | ||
| yoda: 'error', | ||
| 'prefer-const': [ | ||
| 'error', | ||
| { | ||
| destructuring: 'all' | ||
| } | ||
| ], | ||
| 'no-control-regex': 'off', | ||
| 'no-constant-condition': ['error', {checkLoops: false}], | ||
| 'n/no-extraneous-import': 'error' | ||
| } | ||
| }, | ||
| { | ||
| files: ['**/*{test,spec}.ts'], | ||
| languageOptions: { | ||
| globals: { | ||
| describe: 'readonly', | ||
| expect: 'readonly', | ||
| it: 'readonly' | ||
| } | ||
| }, | ||
| rules: { | ||
| ...jestPlugin.configs.recommended.rules, | ||
| '@typescript-eslint/no-unused-vars': 'off', | ||
| 'jest/no-standalone-expect': 'off', | ||
| 'jest/no-conditional-expect': 'off', | ||
| 'no-console': 'off' | ||
| } | ||
| }, | ||
| prettierConfig | ||
| ]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,42 @@ on: | |
| permissions: {} | ||
|
|
||
| jobs: | ||
| build: | ||
| permissions: | ||
| contents: read | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 | ||
| with: | ||
| version: 11.5.2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of my least favorite things about GitHub Actions (and the list is long!) is that there's no automatic mechanism for bumping these values, without either a.) writing your own custom script to do it, or b.) having an agent do it, and both kinda suck. This isn't a reason not to do this on its own, but it's something I'd love to resolve if we go this way. |
||
|
|
||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: '24' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one too |
||
| cache: pnpm | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
|
|
||
| - run: pnpm run format-check | ||
|
|
||
| - run: pnpm run lint | ||
|
|
||
| - run: pnpm test | ||
|
|
||
| - run: pnpm run build | ||
|
|
||
| - name: Check generated dist | ||
| run: git diff --exit-code -- dist | ||
|
|
||
| test-ko-action: | ||
| needs: build | ||
|
|
||
| strategy: | ||
| matrix: | ||
| runner: | ||
|
|
@@ -52,9 +87,7 @@ jobs: | |
| version: tip | ||
|
|
||
| - name: Check installed version (tip) | ||
| run: | | ||
| sudo rm /usr/local/bin/ko # Uninstall previous versions. | ||
| ko version | ||
| run: ko version | ||
|
|
||
| # If KO_DOCKER_REPO is set during setup, it's set for future steps. | ||
| - name: Pre-set KO_DOCKER_REPO | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| node_modules/ | ||
| lib/ | ||
|
|
||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| lerna-debug.log* | ||
|
|
||
| # Diagnostic reports | ||
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Directory for instrumented libs generated by jscoverage/JSCover | ||
| lib-cov | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage | ||
| *.lcov | ||
|
|
||
| # nyc test coverage | ||
| .nyc_output | ||
|
|
||
| # Grunt intermediate storage | ||
| .grunt | ||
|
|
||
| # Compiled binary addons | ||
| build/Release | ||
|
|
||
| # Dependency directories | ||
| jspm_packages/ | ||
|
|
||
| # TypeScript cache | ||
| *.tsbuildinfo | ||
|
|
||
| # Optional package manager caches | ||
| .npm | ||
| .pnpm-store | ||
|
|
||
| # Optional eslint cache | ||
| .eslintcache | ||
|
|
||
| # Optional REPL history | ||
| .node_repl_history | ||
|
|
||
| # Output of package archives | ||
| *.tgz | ||
|
|
||
| # dotenv environment variables file | ||
| .env | ||
| .env.test | ||
|
|
||
| # Bundler and framework caches | ||
| .cache | ||
| .next | ||
| .nuxt | ||
| .vuepress/dist | ||
| .serverless/ | ||
| .fusebox/ | ||
|
|
||
| # IDE metadata | ||
| .idea/ | ||
| .DS_Store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. | ||
| module.exports = { | ||
| printWidth: 80, | ||
| tabWidth: 2, | ||
| useTabs: false, | ||
| semi: true, | ||
| singleQuote: true, | ||
| trailingComma: 'none', | ||
| bracketSpacing: false, | ||
| arrowParens: 'avoid' | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What little Go is in this repo doesn't even have external deps, so we can probably just remove this.
(Not necessarily in this PR, just making a note of it)