mirror of
https://github.com/ivabus/pantry
synced 2024-11-13 03:55:18 +03:00
forgot deno needs a bigger env
This commit is contained in:
parent
2667d8c543
commit
7007a564b6
|
@ -9,8 +9,16 @@ args:
|
||||||
- --allow-write
|
- --allow-write
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
import { panic } from "utils";
|
import { panic } from "utils"
|
||||||
|
import { Package, PackageRequirement } from "types"
|
||||||
|
import * as ARGV from "./utils/args.ts"
|
||||||
|
|
||||||
|
const exceptions: { [project: string]: number } = {
|
||||||
|
"deno.land": 4,
|
||||||
|
"ziglang.org": 8,
|
||||||
|
}
|
||||||
|
|
||||||
|
const packages = await ARGV.toArray(ARGV.pkgs())
|
||||||
type Output = {
|
type Output = {
|
||||||
os: OS,
|
os: OS,
|
||||||
buildOs: OS,
|
buildOs: OS,
|
||||||
|
@ -66,7 +74,7 @@ const output: Output = (() => {
|
||||||
const os = "ubuntu-latest"
|
const os = "ubuntu-latest"
|
||||||
const container = "ghcr.io/teaxyz/infuser:latest"
|
const container = "ghcr.io/teaxyz/infuser:latest"
|
||||||
return { os,
|
return { os,
|
||||||
buildOs: os,
|
buildOs: sizedUbuntu(packages),
|
||||||
container,
|
container,
|
||||||
testMatrix: [
|
testMatrix: [
|
||||||
{ os },
|
{ os },
|
||||||
|
@ -92,3 +100,15 @@ if (Deno.env.get("GITHUB_OUTPUT")) {
|
||||||
const envFile = Deno.env.get("GITHUB_OUTPUT")!
|
const envFile = Deno.env.get("GITHUB_OUTPUT")!
|
||||||
await Deno.writeTextFile(envFile, rv, { append: true})
|
await Deno.writeTextFile(envFile, rv, { append: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sizedUbuntu(packages: (Package | PackageRequirement)[]): string {
|
||||||
|
const size = Math.max(...packages.map(p => exceptions[p.project] ?? 2))
|
||||||
|
|
||||||
|
if (size == 2) {
|
||||||
|
return "ubuntu-latest"
|
||||||
|
} else if ([4, 8, 16].includes(size)) {
|
||||||
|
return `ubuntu-latest-${size}-cores`
|
||||||
|
} else {
|
||||||
|
panic(`Invalid size: ${size}`)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue