mirror of
https://github.com/ivabus/pantry
synced 2025-06-08 08:20:32 +03:00
more-tests (#106)
This commit is contained in:
parent
ac5c6ceff3
commit
a32cd0e80a
4 changed files with 46 additions and 16 deletions
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
@ -1,11 +1,6 @@
|
||||||
name: ci
|
name: ci
|
||||||
on: pull_request
|
on: pull_request
|
||||||
|
|
||||||
# concurrency:
|
|
||||||
# #TODO group: ${{ github.ref }}
|
|
||||||
# group: only-one-due-to-versions.txt-generation-requiring-serial-ness
|
|
||||||
# cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-diff:
|
get-diff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -5,6 +5,13 @@ distributable:
|
||||||
provides:
|
provides:
|
||||||
- bin/pkg-config
|
- bin/pkg-config
|
||||||
|
|
||||||
|
#NOTE that macOS provides some `.pc` files in /usr/lib/pkgconfig
|
||||||
|
# we don’t explicitly include them. This should be safe since we set
|
||||||
|
# PKG_CONFIG_PATH and that is checked first. But it could lead to issues
|
||||||
|
# for users in some circumstances.
|
||||||
|
#FIXME probably we should exclude this in the pursuit of reliable, cross
|
||||||
|
# platform environments.
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
github: freedesktop/pkg-config/tags
|
github: freedesktop/pkg-config/tags
|
||||||
strip: /^pkg-config-/
|
strip: /^pkg-config-/
|
||||||
|
@ -14,14 +21,16 @@ build:
|
||||||
tea.xyz/gx/cc: c99
|
tea.xyz/gx/cc: c99
|
||||||
tea.xyz/gx/make: '*'
|
tea.xyz/gx/make: '*'
|
||||||
script: |-
|
script: |-
|
||||||
./configure \
|
./configure $ARGS
|
||||||
--prefix="{{ prefix }}" \
|
make --jobs {{ hw.concurrency }} install
|
||||||
--disable-debug \
|
env:
|
||||||
--disable-host-tool \
|
ARGS:
|
||||||
--with-internal-glib \
|
- --prefix="{{ prefix }}"
|
||||||
--with-pc-path=/usr/lib/pkgconfig #FIXME
|
- --disable-debug
|
||||||
make --jobs {{ hw.concurrency }}
|
- --disable-host-tool
|
||||||
make install
|
- --with-internal-glib
|
||||||
|
# otherwise the defaults are based on our {{prefix}}
|
||||||
|
- --with-pc-path=/usr/lib/pkgconfig:/usr/share/pkgconfig
|
||||||
|
|
||||||
test:
|
test:
|
||||||
script: pkg-config --version
|
script: pkg-config --version
|
||||||
|
|
|
@ -20,4 +20,11 @@ build:
|
||||||
--prefix="{{ prefix }}"
|
--prefix="{{ prefix }}"
|
||||||
make --jobs {{ hw.concurrency }} install
|
make --jobs {{ hw.concurrency }} install
|
||||||
|
|
||||||
test: true #FIXME
|
test:
|
||||||
|
dependencies:
|
||||||
|
curl.se: '*'
|
||||||
|
env:
|
||||||
|
FIXTURE: https://samplelib.com/lib/preview/jpeg/sample-clouds-400x300.jpg
|
||||||
|
script: |
|
||||||
|
curl $FIXTURE > test.jpeg
|
||||||
|
djpeg test.jpeg
|
||||||
|
|
|
@ -7,7 +7,7 @@ args:
|
||||||
- --allow-net
|
- --allow-net
|
||||||
- --allow-run
|
- --allow-run
|
||||||
- --allow-read
|
- --allow-read
|
||||||
- --allow-write=/opt/tea.xyz/tmp
|
- --allow-write
|
||||||
- --allow-env
|
- --allow-env
|
||||||
- --import-map={{ srcroot }}/import-map.json
|
- --import-map={{ srcroot }}/import-map.json
|
||||||
---*/
|
---*/
|
||||||
|
@ -19,16 +19,20 @@ import { run, undent, isPlainObject } from "utils"
|
||||||
import { validatePackageRequirement } from "utils/lvl2.ts"
|
import { validatePackageRequirement } from "utils/lvl2.ts"
|
||||||
import useFlags from "hooks/useFlags.ts"
|
import useFlags from "hooks/useFlags.ts"
|
||||||
import useCellar from "hooks/useCellar.ts"
|
import useCellar from "hooks/useCellar.ts"
|
||||||
|
import resolve from "prefab/resolve.ts"
|
||||||
|
import install from "prefab/install.ts"
|
||||||
import hydrate from "prefab/hydrate.ts"
|
import hydrate from "prefab/hydrate.ts"
|
||||||
|
import { lvl1 as link } from "prefab/link.ts"
|
||||||
|
|
||||||
const { debug } = useFlags()
|
const { debug } = useFlags()
|
||||||
|
const cellar = useCellar()
|
||||||
|
|
||||||
//TODO install any other deps
|
//TODO install any other deps
|
||||||
|
|
||||||
const pantry = usePantry()
|
const pantry = usePantry()
|
||||||
const pkg = await (async () => {
|
const pkg = await (async () => {
|
||||||
if (Deno.args[1] == "--magic") {
|
if (Deno.args[1] == "--magic") {
|
||||||
const i = await useCellar().resolve(parsePackageRequirement(Deno.args[0]))
|
const i = await cellar.resolve(parsePackageRequirement(Deno.args[0]))
|
||||||
return i.pkg
|
return i.pkg
|
||||||
} else {
|
} else {
|
||||||
return parsePackage(Deno.args[0])
|
return parsePackage(Deno.args[0])
|
||||||
|
@ -42,6 +46,8 @@ const self = {
|
||||||
const [yml] = await pantry.getYAML(pkg)
|
const [yml] = await pantry.getYAML(pkg)
|
||||||
const deps: PackageRequirement[] = [self, ...await get_deps()]
|
const deps: PackageRequirement[] = [self, ...await get_deps()]
|
||||||
|
|
||||||
|
await install_if_needed(deps)
|
||||||
|
|
||||||
const env = await useShellEnv(deps)
|
const env = await useShellEnv(deps)
|
||||||
|
|
||||||
let text = undent`
|
let text = undent`
|
||||||
|
@ -98,3 +104,16 @@ async function get_deps() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function install_if_needed(deps: PackageRequirement[]) {
|
||||||
|
const needed: PackageRequirement[] = []
|
||||||
|
for await (const rq of deps) {
|
||||||
|
if (await cellar.isInstalled(rq)) continue
|
||||||
|
needed.push(rq)
|
||||||
|
}
|
||||||
|
const wet = await resolve(needed)
|
||||||
|
for (const pkg of wet) {
|
||||||
|
const installation = install(pkg)
|
||||||
|
await link(installation)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue