mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 18:50:10 +08:00
ci: jsr registry test
This commit is contained in:
parent
bd8e499b49
commit
9de686f606
33
.github/workflows/test.yml
vendored
33
.github/workflows/test.yml
vendored
@ -167,3 +167,36 @@ jobs:
|
|||||||
id: run_bun
|
id: run_bun
|
||||||
run: |
|
run: |
|
||||||
bun --version
|
bun --version
|
||||||
|
|
||||||
|
setup-bun-jsr-registry:
|
||||||
|
name: setup-bun jsr registry (${{ matrix.os }})
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
continue-on-error: true
|
||||||
|
needs: [remove-cache, tests]
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
- windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: ./
|
||||||
|
id: setup_bun
|
||||||
|
with:
|
||||||
|
registries: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"url": "https://npm.jsr.io"
|
||||||
|
"scope": "@jsr"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
- name: Run Bun
|
||||||
|
id: run_bun
|
||||||
|
run: |
|
||||||
|
bun add @luca/runtime-detector
|
||||||
|
@ -5,7 +5,7 @@ import { info } from "@actions/core";
|
|||||||
export type Registry = {
|
export type Registry = {
|
||||||
url: string;
|
url: string;
|
||||||
scope: string;
|
scope: string;
|
||||||
token: string;
|
token?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FieldType {
|
enum FieldType {
|
||||||
@ -40,7 +40,9 @@ export function createField(registry: Registry): Field {
|
|||||||
if (url && owner) {
|
if (url && owner) {
|
||||||
return {
|
return {
|
||||||
type: FieldType.INSTALL_WITH_SCOPE,
|
type: FieldType.INSTALL_WITH_SCOPE,
|
||||||
value: `'${owner}' = { token = "${token}", url = "${url}" }`,
|
value: `'${owner}' = { url = "${url}"${
|
||||||
|
token ? `, token = "${token}"` : ""
|
||||||
|
} }`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ describe("writeBunfig", () => {
|
|||||||
|
|
||||||
const expectedContents = [
|
const expectedContents = [
|
||||||
"[install.scopes]",
|
"[install.scopes]",
|
||||||
'\'@foo-bar\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@foo-bar\' = { url = "https://npm.pkg.github.com/", token = "$BUN_AUTH_TOKEN" }',
|
||||||
"",
|
"",
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ describe("writeBunfig", () => {
|
|||||||
"[install.cache]",
|
"[install.cache]",
|
||||||
"disable = true",
|
"disable = true",
|
||||||
"[install.scopes]",
|
"[install.scopes]",
|
||||||
'\'@foo-bar\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@foo-bar\' = { url = "https://npm.pkg.github.com/", token = "$BUN_AUTH_TOKEN" }',
|
||||||
"",
|
"",
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ describe("writeBunfig", () => {
|
|||||||
"optional = true",
|
"optional = true",
|
||||||
"",
|
"",
|
||||||
"[install.scopes]",
|
"[install.scopes]",
|
||||||
'\'@foo-bar\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@foo-bar\' = { url = "https://npm.pkg.github.com/", token = "$BUN_AUTH_TOKEN" }',
|
||||||
'\'@bla-ble\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@bla-ble\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
||||||
"",
|
"",
|
||||||
"[install.cache]",
|
"[install.cache]",
|
||||||
@ -167,7 +167,7 @@ describe("writeBunfig", () => {
|
|||||||
"optional = true",
|
"optional = true",
|
||||||
"",
|
"",
|
||||||
"[install.scopes]",
|
"[install.scopes]",
|
||||||
'\'@foo-bar\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@foo-bar\' = { url = "https://npm.pkg.github.com/", token = "$BUN_AUTH_TOKEN" }',
|
||||||
'\'@bla-ble\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@bla-ble\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
||||||
"",
|
"",
|
||||||
"[install.cache]",
|
"[install.cache]",
|
||||||
@ -210,7 +210,7 @@ describe("writeBunfig", () => {
|
|||||||
"optional = true",
|
"optional = true",
|
||||||
"",
|
"",
|
||||||
"[install.scopes]",
|
"[install.scopes]",
|
||||||
'\'@foo-bar\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@foo-bar\' = { url = "https://npm.pkg.github.com/", token = "$BUN_AUTH_TOKEN" }',
|
||||||
'\'@bla-ble\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
'\'@bla-ble\' = { token = "$BUN_AUTH_TOKEN", url = "https://npm.pkg.github.com/" }',
|
||||||
"",
|
"",
|
||||||
"[install.cache]",
|
"[install.cache]",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user