don’t need cli checkouts anymore (#146)

* don’t need cli checkouts anymore
* tidy

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
Max Howell 2023-02-02 09:00:52 -05:00 committed by GitHub
parent 0ee361a5d7
commit abb0921f3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 68 additions and 170 deletions

View file

@ -7,30 +7,19 @@ on:
required: true
type: string
env:
TEA_PANTRY_PATH: ${{ github.workspace }}/pantry
jobs:
check-core-sizes:
runs-on: ubuntu-latest
outputs:
gha-linux-build-size: ${{ env.GHA_LINUX_BUILD_SIZE }}
steps:
- name: co pantry
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
path: pantry
repository: teaxyz/pantry.core
- uses: teaxyz/setup@v0
with:
# necessary because we currently require a `.git` directory
srcroot: pantry
- run: ./scripts/check-core-sizes.ts ${{ inputs.projects }}
working-directory: pantry
- run: scripts/check-core-sizes.ts ${{ inputs.projects }}
env:
TEA_PANTRY_PATH: ${{ env.TEA_PANTRY_PATH }}
TEA_PANTRY_PATH: ${{ github.workspace }}
build:
runs-on: ${{ matrix.platform.os }}
@ -50,57 +39,38 @@ jobs:
name: linux+aarch64
container: ${{ matrix.platform.container }}
steps:
- name: co pantry
uses: actions/checkout@v3
with:
path: pantry
- name: co cli
uses: actions/checkout@v3
with:
path: cli
repository: teaxyz/cli
- uses: actions/checkout@v3
- uses: teaxyz/setup@v0
id: tea
with:
# necessary because we currently require a `.git` directory
srcroot: /opt/tea.xyz/var/pantry
prefix: /opt
- name: HACKS
- name: sanitize macOS runners
if: matrix.platform.os == 'macos-11'
run: sudo mv /usr/local/bin/* /tmp/
- name: configure tea env
run: |
case ${{ matrix.platform.os }} in
macos-11)
#FIXME we need a clean install of macOS for builds
#TODO stop using GHA images or chroot or something
for x in /usr/local/*; do sudo mv $x /tmp; done
;;
esac
echo "$PWD/scripts:$TEA_PREFIX/tea.xyz/var/pantry/scripts" >> $GITHUB_PATH
echo "TEA_PANTRY_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
ln -s $GITHUB_WORKSPACE/cli /opt/tea.xyz/var/cli
# in case this PR contains updates to the scripts
#TODO only do for PRs
if test "$GITHUB_REPOSITORY" = "teaxyz/pantry.core"; then
cp -rv pantry/scripts/* /opt/tea.xyz/var/pantry/scripts
fi
- run: /opt/tea.xyz/var/pantry/scripts/sort.ts ${{ inputs.projects }}
- run: sort.ts ${{ inputs.projects }}
id: sorted
# running out of /opt because only pantry.core has these scripts
- run: /opt/tea.xyz/var/pantry/scripts/build.ts ${{ steps.sorted.outputs.pkgs }}
- run: build.ts ${{ steps.sorted.outputs.pkgs }}
id: build
env:
GITHUB_TOKEN: ${{ github.token }}
FORCE_UNSAFE_CONFIGURE: 1 # some configure scripts refuse to run as root
- name: delete `.la` files
run: find ${{ steps.tea.outputs.prefix }} -name '*.la' -delete
run: find . -name '*.la' -delete
working-directory: ${{ steps.tea.outputs.prefix }}
# cache data we'll need in the bottling job
- run: |
- name: assemble artifact metadata
run: |
echo ${{ steps.build.outputs.pkgs }} >built
echo ${{ steps.build.outputs.relative-paths }} >relative-paths
echo ${{ steps.build.outputs.srcs }} >srcs
@ -108,7 +78,8 @@ jobs:
# tarring ourselves ∵ GHA-artifacts (ludicrously) lose permissions
# /ref https://github.com/actions/upload-artifact/issues/38
- run:
- name: create artifacts.tgz
run:
tar czf $GITHUB_WORKSPACE/artifacts.tgz
${{ steps.build.outputs.relative-paths }}
${{ steps.build.outputs.srcs-relative-paths }}
@ -147,36 +118,24 @@ jobs:
container: ${{ matrix.platform.container }}
steps:
- uses: actions/checkout@v3
with:
path: tea.xyz/var/cli
repository: teaxyz/cli
- uses: actions/checkout@v3
with:
path: pantry
- uses: teaxyz/setup@v0
id: tea
with:
srcroot: tea.xyz/var/pantry
prefix: ${{ github.workspace }}
- run: |
# in case this PR contains updates to the scripts TODO only PRs
if test "$GITHUB_REPOSITORY" = "teaxyz/pantry.core"; then
cp -rv pantry/scripts/* $(tea --prefix)/tea.xyz/var/pantry/scripts
fi
if: ${{ matrix.platform.container != '' }}
- name: configure scripts PATH
run: echo "$PWD/scripts:$TEA_PREFIX/tea.xyz/var/pantry/scripts" >> $GITHUB_PATH
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.platform.name }}
- run: tar xzf artifacts.tgz
- name: extract bottles
run: tar xzf artifacts.tgz -C $TEA_PREFIX
- run: tea.xyz/var/pantry/scripts/test.ts ${{ inputs.projects }}
- run: test.ts ${{ inputs.projects }}
env:
TEA_PANTRY_PATH: ${{ github.workspace }}
- run:
- name: post
run:
echo "HAS_SECRETS=$HAS_SECRETS" >>$GITHUB_ENV
env:
HAS_SECRETS: ${{ secrets.AWS_S3_CACHE != null }}
@ -199,34 +158,16 @@ jobs:
name: linux+aarch64
steps:
- uses: actions/checkout@v3
with:
path: tea.xyz/var/cli
repository: teaxyz/cli
- uses: actions/checkout@v3
with:
path: pantry
- uses: teaxyz/setup@v0
id: tea
with:
srcroot: tea.xyz/var/pantry
prefix: ${{ github.workspace }}
- run: |
tea --sync
# in case this PR contains updates to the scripts
#TODO only do for PRs
if test "$GITHUB_REPOSITORY" = "teaxyz/pantry.core"; then
cp -rv $GITHUB_WORKSPACE/pantry/scripts/* $(tea --prefix)/tea.xyz/var/pantry/scripts
fi
- name: configure scripts PATH
run: echo "$PWD/scripts:$TEA_PREFIX/tea.xyz/var/pantry/scripts" >> $GITHUB_PATH
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.platform.name }}
- run:
tea.xyz/var/pantry/scripts/cache-artifacts.ts
- run: cache-artifacts.ts
${{github.repository}}
${{github.ref}}
${{matrix.platform.name}}

View file

@ -3,8 +3,7 @@ name: ci-scripts
on:
pull_request:
paths:
- scripts/**.ts
- import-map.json
- scripts/**/*.ts
jobs:
typecheck:
@ -14,4 +13,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: teaxyz/setup@v0
- run: tea deno check --unstable --import-map=import-map.json scripts/*.ts
- run: deno check --unstable scripts/*.ts

View file

@ -7,11 +7,8 @@ on:
required: true
type: string
env:
TEA_PANTRY_PATH: ${{ github.workspace }}/pantry
jobs:
queue_detail_ingestion:
queue-detail-ingestion:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -33,5 +30,5 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
TEA_PANTRY_PATH: ${{ env.TEA_PANTRY_PATH }}
SQS_GENERATE_PACKAGE_DETAILS_URL: ${{ secrets.SQS_GENERATE_PACKAGE_DETAILS_URL }}
TEA_PANTRY_PATH: ${{ github.workspace }}

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# for pre 1!
/deno.lock

View file

@ -2,6 +2,5 @@
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"deno.importMap": "import-map.json",
"deno.config": "tsconfig.json"
"deno.config": "deno.jsonc"
}

View file

@ -17,17 +17,5 @@ versioned.
See the contributing guide in [pantry.zero].
&nbsp;
# Meta
## Dependencies
| Project | Version |
|-------------|---------|
| deno.land | ^1.27 |
| tea.xyz | ^0 |
[pantry.zero]: https://github.com/teaxyz/pantry.zero#contributing
[pantry.extra]: https://github.com/teaxyz/pantry.extra

24
deno.jsonc Normal file
View file

@ -0,0 +1,24 @@
{
"compilerOptions": {
"allowJs": false,
"strict": true
},
"tasks": {
"typecheck": "deno check --unstable scripts/*.ts"
// ^^ doesn't work yet due to lack of glob support
},
"fmt": {
"files": {
"exclude": [
"./"
]
}
},
"tea": {
"dependencies": {
"deno.land": "^1.30"
}
},
"importMap": "https://raw.githubusercontent.com/teaxyz/cli/v0.21/import-map.json"
// ^^ stuck in the past because we moved the import map into deno.json :-/
}

View file

@ -1,20 +0,0 @@
{
"imports": {
"prefab": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/prefab/index.ts",
"semver": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/utils/semver.ts",
"hooks": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/hooks/index.ts",
"utils": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/utils/index.ts",
"path": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/vendor/Path.ts",
"prefab/": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/prefab/",
"types": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/types.ts",
"hooks/": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/hooks/",
"utils/": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/utils/",
"deno/": "https://deno.land/std@0.173.0/",
"is_what": "https://deno.land/x/is_what@v4.1.7/src/index.ts",
"cliffy/": "https://deno.land/x/cliffy@v0.25.2/",
"s3": "https://deno.land/x/s3@0.5.0/mod.ts",
"outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts",
"sha256": "https://deno.land/std@0.160.0/hash/sha256.ts",
"rimbu/": "https://deno.land/x/rimbu@0.12.3/"
}
}

View file

@ -14,7 +14,6 @@ args:
- --allow-env
- --allow-read
- --allow-write
- --import-map={{ srcroot }}/import-map.json
--- */
import { Installation } from "types"

View file

@ -8,7 +8,6 @@ args:
- --allow-env
- --allow-read
- --allow-write={{tea.prefix}}
- --import-map={{ srcroot }}/import-map.json
dependencies:
nixos.org/patchelf: '*'
darwinsys.com/file: 5

View file

@ -8,7 +8,6 @@ args:
- --allow-env
- --allow-read
- --allow-write={{tea.prefix}}
- --import-map={{ srcroot }}/import-map.json
--- */
import Path from "path"

View file

@ -6,7 +6,6 @@ args:
- run
- --allow-read
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
import { Package, PackageRequirement } from "types"

View file

@ -10,7 +10,6 @@ args:
- --allow-write={{tea.prefix}}
- --allow-env
- --unstable
- --import-map={{ srcroot }}/import-map.json
---*/
import { usePantry } from "hooks"

View file

@ -10,7 +10,6 @@ args:
- --allow-write={{tea.prefix}}
- --allow-env
- --unstable
- --import-map={{ srcroot }}/import-map.json
---*/
import { usePantry, useFlags, useCellar, useInventory, usePrefix } from "hooks"

View file

@ -7,7 +7,6 @@ args:
- --allow-net
- --allow-read
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
import { S3 } from "s3"

View file

@ -7,7 +7,6 @@ args:
- --allow-read
- --allow-env
- --allow-write
- --import-map={{ srcroot }}/import-map.json
---*/
import * as ARGV from "./utils/args.ts"

View file

@ -7,7 +7,6 @@ args:
- --allow-run
- --allow-read
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
const args = [...Deno.args]

View file

@ -7,7 +7,6 @@ args:
- --allow-net
- --allow-env
- --allow-write=./artifacts.tgz
- --import-map={{ srcroot }}/import-map.json
---*/
/// Test

View file

@ -13,7 +13,6 @@ args:
- --allow-read
- --allow-write={{ tea.prefix }}
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
//TODO verify the sha

View file

@ -6,7 +6,6 @@ args:
- run
- --allow-read
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
import { useCellar, useFlags } from "hooks"

View file

@ -6,7 +6,6 @@ args:
- run
- --allow-net
- --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET
- --import-map={{ srcroot }}/import-map.json
---*/
import { S3, S3Object } from "s3"

View file

@ -6,7 +6,6 @@ args:
- run
- --allow-net
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
/// Test

View file

@ -7,7 +7,6 @@ args:
- --allow-net
- --allow-read
- --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET
- --import-map={{ srcroot }}/import-map.json
---*/
import { S3 } from "s3"

View file

@ -6,7 +6,6 @@ args:
- run
- --allow-env
- --allow-net
- --import-map={{ srcroot }}/import-map.json
---*/
import { S3 } from "s3"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env -S tea -E
// returns all pantry entries as `[{ name, path }]`
/// returns all pantry entries as `[{ name, path }]`
/*---
args:
@ -8,7 +8,6 @@ args:
- run
- --allow-env
- --allow-read
- --import-map={{ srcroot }}/import-map.json
---*/
import Path from "path"

View file

@ -7,7 +7,6 @@ args:
- --allow-read
- --allow-env
- --allow-net
- --import-map={{ srcroot }}/import-map.json
---*/
import { usePantry } from "hooks"

View file

@ -6,7 +6,6 @@ args:
- run
- --allow-read
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
// sorts input for building

View file

@ -10,7 +10,6 @@ args:
- --allow-write
- --allow-env
- --unstable
- --import-map={{ srcroot }}/import-map.json
---*/
import { Installation, Package, PackageRequirement } from "types"

View file

@ -7,7 +7,6 @@ args:
- --allow-read
- --allow-net
- --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET,TEA_PREFIX
- --import-map={{ srcroot }}/import-map.json
---*/
import { readAll, readerFromStreamReader } from "deno/streams/mod.ts"

View file

@ -7,7 +7,6 @@ args:
- --allow-net
- --allow-read
- --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/
import { S3, S3Bucket } from "s3"

View file

@ -1,10 +0,0 @@
{
"compilerOptions": {
"allowJs": false,
"target": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"module": "ESNext",
"strict": true,
}
}