diff --git a/.eslintrc.json b/.eslintrc.json index bb270f9..eb8df77 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,57 +1,63 @@ { - "plugins": ["jest", "@typescript-eslint"], - "extends": ["plugin:github/recommended"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 9, - "sourceType": "module", - "project": "./tsconfig.json" - }, - "rules": { - "no-shadow": "off", - "@typescript-eslint/no-shadow": ["error"], - "i18n-text/no-en": "off", - "eslint-comments/no-use": "off", - "import/no-namespace": "off", - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], - "@typescript-eslint/no-require-imports": "error", - "@typescript-eslint/array-type": "error", - "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/ban-ts-comment": "error", - "camelcase": "off", - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], - "@typescript-eslint/func-call-spacing": ["error", "never"], - "@typescript-eslint/no-array-constructor": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "error", - "@typescript-eslint/no-extraneous-class": "error", - "@typescript-eslint/no-for-in-array": "error", - "@typescript-eslint/no-inferrable-types": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-non-null-assertion": "warn", - "@typescript-eslint/no-unnecessary-qualifier": "error", - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/no-useless-constructor": "error", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-for-of": "warn", - "@typescript-eslint/prefer-function-type": "warn", - "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/prefer-string-starts-ends-with": "error", - "@typescript-eslint/promise-function-async": "error", - "@typescript-eslint/require-array-sort-compare": "error", - "@typescript-eslint/restrict-plus-operands": "error", - "semi": "off", - "@typescript-eslint/semi": ["error", "never"], - "@typescript-eslint/type-annotation-spacing": "error", - "@typescript-eslint/unbound-method": "error" - }, - "env": { - "node": true, - "es6": true, - "jest/globals": true - } - } \ No newline at end of file + "plugins": ["jest", "@typescript-eslint"], + "extends": ["plugin:github/recommended"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "module", + "project": "./tsconfig.json" + }, + "rules": { + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error"], + "i18n-text/no-en": "off", + "eslint-comments/no-use": "off", + "import/no-namespace": "off", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/explicit-member-accessibility": [ + "error", + {"accessibility": "no-public"} + ], + "@typescript-eslint/no-require-imports": "error", + "@typescript-eslint/array-type": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/ban-ts-comment": "error", + "camelcase": "off", + "@typescript-eslint/consistent-type-assertions": "error", + "@typescript-eslint/explicit-function-return-type": [ + "error", + {"allowExpressions": true} + ], + "@typescript-eslint/func-call-spacing": ["error", "never"], + "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-empty-interface": "error", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-extraneous-class": "error", + "@typescript-eslint/no-for-in-array": "error", + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-non-null-assertion": "warn", + "@typescript-eslint/no-unnecessary-qualifier": "error", + "@typescript-eslint/no-unnecessary-type-assertion": "error", + "@typescript-eslint/no-useless-constructor": "error", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-for-of": "warn", + "@typescript-eslint/prefer-function-type": "warn", + "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/prefer-string-starts-ends-with": "error", + "@typescript-eslint/promise-function-async": "error", + "@typescript-eslint/require-array-sort-compare": "error", + "@typescript-eslint/restrict-plus-operands": "error", + "semi": "off", + "@typescript-eslint/semi": ["error", "never"], + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/unbound-method": "error" + }, + "env": { + "node": true, + "es6": true, + "jest/globals": true + } +} diff --git a/.github/python.json b/.github/python.json index 1052a1c..3e5d8d5 100644 --- a/.github/python.json +++ b/.github/python.json @@ -1,18 +1,18 @@ { - "problemMatcher": [ + "problemMatcher": [ + { + "owner": "python", + "pattern": [ { - "owner": "python", - "pattern": [ - { - "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", - "file": 1, - "line": 2 - }, - { - "regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", - "message": 2 - } - ] + "regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$", + "file": 1, + "line": 2 + }, + { + "regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$", + "message": 2 } - ] -} \ No newline at end of file + ] + } + ] +} diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index eb764e1..668e8a7 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,31 +1,31 @@ name-template: 'v$RESOLVED_VERSION 🌈' tag-template: 'v$RESOLVED_VERSION' categories: - - title: "🚨 Breaking changes" + - title: '🚨 Breaking changes' labels: - - "breaking-change" - - title: "✨ New features" + - 'breaking-change' + - title: '✨ New features' labels: - - "new-feature" - - title: "🐛 Bug fixes" + - 'new-feature' + - title: '🐛 Bug fixes' labels: - - "bugfix" - - title: "🚀 Enhancements" + - 'bugfix' + - title: '🚀 Enhancements' labels: - - "enhancement" - - "refactor" - - "performance" - - title: "🧰 Maintenance" + - 'enhancement' + - 'refactor' + - 'performance' + - title: '🧰 Maintenance' labels: - - "maintenance" - - "ci" - - "default-version-update" - - title: "📚 Documentation" + - 'maintenance' + - 'ci' + - 'default-version-update' + - title: '📚 Documentation' labels: - - "documentation" - - title: "âŦ†ī¸ Dependency updates" + - 'documentation' + - title: 'âŦ†ī¸ Dependency updates' labels: - - "dependencies" + - 'dependencies' change-template: '- $TITLE @$AUTHOR (#$NUMBER)' change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. version-resolver: @@ -42,9 +42,9 @@ version-resolver: labels: - 'patch' - 'bugfix' - - "default-version-update" + - 'default-version-update' default: patch template: | ## Changes - $CHANGES \ No newline at end of file + $CHANGES diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f5b5821..d01412f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,14 +9,14 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: "CodeQL" +name: 'CodeQL' on: push: - branches: [ main ] + branches: [main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main] schedule: - cron: '31 7 * * 3' @@ -32,40 +32,40 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'TypeScript' ] + language: ['TypeScript'] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://git.io/codeql-language-support steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - source-root: src - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + source-root: src + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, 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@v3 + # Autobuild attempts to build any compiled languages (C/C++, C#, 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@v3 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - #- run: | - # make bootstrap - # make release + #- run: | + # make bootstrap + # make release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 8c1db69..9d1d445 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -16,4 +16,4 @@ jobs: - name: 🚀 Run Release Drafter uses: release-drafter/release-drafter@v6.0.0 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-cache-windows.yml b/.github/workflows/test-cache-windows.yml index a60ea41..b00eafa 100644 --- a/.github/workflows/test-cache-windows.yml +++ b/.github/workflows/test-cache-windows.yml @@ -36,8 +36,8 @@ jobs: id: restore uses: ./ with: - enable-cache: true - cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }} + enable-cache: true + cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }} - name: Cache was hit run: | if ($env:CACHE_HIT -ne "true") { diff --git a/.github/workflows/test-cache.yml b/.github/workflows/test-cache.yml index 93c1634..d889d92 100644 --- a/.github/workflows/test-cache.yml +++ b/.github/workflows/test-cache.yml @@ -36,8 +36,8 @@ jobs: id: restore uses: ./ with: - enable-cache: true - cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }} + enable-cache: true + cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }} - name: Cache was hit run: | if [ "$CACHE_HIT" != "true" ]; then @@ -69,9 +69,9 @@ jobs: id: restore uses: ./ with: - enable-cache: true - cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }} - cache-local-path: /tmp/uv-cache + enable-cache: true + cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }} + cache-local-path: /tmp/uv-cache - name: Cache was hit run: | if [ "$CACHE_HIT" != "true" ]; then diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 124112f..65543dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, macos-14, oracle-aarch64] - uv-version: ['latest','0.3.0','0.3.2'] + uv-version: ['latest', '0.3.0', '0.3.2'] steps: - uses: actions/checkout@v4 - name: Install version ${{ matrix.uv-version }} @@ -57,7 +57,8 @@ jobs: strategy: matrix: os: [ubuntu-latest, oracle-aarch64] - checksum: ['4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd'] + checksum: + ['4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd'] exclude: - os: oracle-aarch64 checksum: '4d9279ad5ca596b1e2d703901d508430eb07564dc4d8837de9e2fca9c90f8ecd' diff --git a/.github/workflows/update-default-version.yml b/.github/workflows/update-default-version.yml index 6dfad15..3d8bd06 100644 --- a/.github/workflows/update-default-version.yml +++ b/.github/workflows/update-default-version.yml @@ -12,15 +12,22 @@ jobs: node-version: '20' - name: Update default version and checksums id: update-default-version - run: node dist/update-default-version/index.js src/download/checksum/known-checksums.ts action.yml ${{ secrets.GITHUB_TOKEN }} + run: + node dist/update-default-version/index.js + src/download/checksum/known-checksums.ts action.yml ${{ + secrets.GITHUB_TOKEN }} - run: npm install && npm run all - name: Create Pull Request - uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v7.0.0 + uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79 # v7.0.0 with: - commit-message: "chore: update checksums" - title: "chore: update default version to ${{ steps.update-default-version.outputs.latest-version }}" - body: "chore: update default version to ${{ steps.update-default-version.outputs.latest-version }}" - base: main - labels: "automated-pr,default-version-update" - branch: update-default-version-pr - delete-branch: true \ No newline at end of file + commit-message: 'chore: update checksums' + title: + 'chore: update default version to ${{ + steps.update-default-version.outputs.latest-version }}' + body: + 'chore: update default version to ${{ + steps.update-default-version.outputs.latest-version }}' + base: main + labels: 'automated-pr,default-version-update' + branch: update-default-version-pr + delete-branch: true diff --git a/.github/workflows/update-major-minor-tags.yml b/.github/workflows/update-major-minor-tags.yml index bafc481..bba1206 100644 --- a/.github/workflows/update-major-minor-tags.yml +++ b/.github/workflows/update-major-minor-tags.yml @@ -16,4 +16,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: Run Update semver - uses: haya14busa/action-update-semver@v1.2.1 \ No newline at end of file + uses: haya14busa/action-update-semver@v1.2.1 diff --git a/.prettierrc.json b/.prettierrc.json index c34bafc..7a6245d 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -6,5 +6,6 @@ "singleQuote": true, "trailingComma": "none", "bracketSpacing": false, - "arrowParens": "avoid" + "arrowParens": "avoid", + "proseWrap": "always" } diff --git a/README.md b/README.md index 412a237..1ddab17 100644 --- a/README.md +++ b/README.md @@ -2,24 +2,24 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs.astral.sh/uv/). -* Install a version of uv and add it to the path -* Cache the installed version of uv to speed up consecutive runs on self-hosted runners -* Register problem matchers for error output -* Optional: Cache the uv cache -* Optional: Verify the checksum of the downloaded uv executable +- Install a version of uv and add it to the path +- Cache the installed version of uv to speed up consecutive runs on self-hosted runners +- Register problem matchers for error output +- Optional: Cache the uv cache +- Optional: Verify the checksum of the downloaded uv executable ## Contents -* [Usage](#usage) - * [Install specific version](#install-specific-version) - * [Install latest version](#install-latest-version) - * [Validate checksum](#validate-checksum) - * [Enable Caching](#enable-caching) - * [Local cache path](#local-cache-path) - * [Cache dependency glob](#cache-dependency-glob) - * [API rate limit](#api-rate-limit) -* [How it works](#how-it-works) -* [FAQ](#faq) +- [Usage](#usage) + - [Install specific version](#install-specific-version) + - [Install latest version](#install-latest-version) + - [Validate checksum](#validate-checksum) + - [Enable Caching](#enable-caching) + - [Local cache path](#local-cache-path) + - [Cache dependency glob](#cache-dependency-glob) + - [API rate limit](#api-rate-limit) +- [How it works](#how-it-works) +- [FAQ](#faq) ## Usage diff --git a/action.yml b/action.yml index 0dad4a5..8166d27 100644 --- a/action.yml +++ b/action.yml @@ -2,20 +2,24 @@ name: 'Python setup uv' description: 'Set up your GitHub Actions workflow with a specific version of uv' author: 'eifinger' inputs: - version: + version: description: 'The version of uv to install' default: '0.4.4' checksum: description: 'The checksum of the uv version to install' required: false github-token: - description: 'Used to increase the rate limit when retrieving versions and downloading uv.' + description: + 'Used to increase the rate limit when retrieving versions and downloading + uv.' required: false enable-cache: description: 'Enable caching of the uv cache' default: 'false' cache-dependency-glob: - description: 'Glob pattern to match files relative to the repository root to control the cache. e.g. "uv.lock"' + description: + 'Glob pattern to match files relative to the repository root to control + the cache. e.g. "uv.lock"' required: false cache-suffix: description: 'Suffix for the cache key' @@ -25,9 +29,9 @@ inputs: default: '/tmp/setup-uv-cache' outputs: uv-version: - description: "The installed uv version. Useful when using latest." + description: 'The installed uv version. Useful when using latest.' cache-hit: - description: "A boolean value to indicate a cache entry was found" + description: 'A boolean value to indicate a cache entry was found' runs: using: 'node20' main: 'dist/setup/index.js' @@ -35,4 +39,4 @@ runs: post-if: success() branding: icon: 'package' - color: 'blue' \ No newline at end of file + color: 'blue' diff --git a/jest.config.js b/jest.config.js index 5a82228..b0ed2b3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,4 +6,4 @@ module.exports = { '^.+\\.ts$': 'ts-jest' }, verbose: true -} \ No newline at end of file +} diff --git a/package.json b/package.json index 8f642f4..6996bf4 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "main": "dist/index.js", "scripts": { "build": "tsc", - "format": "prettier --write '**/*.ts'", - "format-check": "prettier --check '**/*.ts'", + "format": "prettier --write .", + "format-check": "prettier --check .", "lint": "eslint src/**/*.ts --fix", "package": "ncc build -o dist/setup src/setup-uv.ts && ncc build -o dist/save-cache src/save-cache.ts && ncc build -o dist/update-default-version src/update-default-version.ts", "test": "jest", diff --git a/tsconfig.json b/tsconfig.json index f6e7cb5..4a6c661 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,12 @@ { "compilerOptions": { - "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ - "outDir": "./lib", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + "outDir": "./lib" /* Redirect output structure to the directory. */, + "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + "strict": true /* Enable all strict type-checking options. */, + "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ }, "exclude": ["node_modules", "**/*.test.ts"] }