Skip to content

Commit 216fec6

Browse files
committed
wip
1 parent 6e9130c commit 216fec6

10 files changed

Lines changed: 52 additions & 81 deletions

File tree

.github/modify-pantry/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
runs:
22
using: composite
33
steps:
4-
- run: pkgx --sync #FIXME bug where shebangs don’t cause an auto-sync
5-
shell: bash
64
- uses: fregante/setup-git-user@v2
75
- run: git update-ref refs/remotes/origin/main HEAD
86
working-directory: ${{ github.workspace }}

.github/setup-pantry/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Setup pantry overlay
2+
description: >
3+
Clones upstream pkgxdev/pantry and overlays brewkit's test packages on top.
4+
Sets PKGX_PANTRY_DIR and PKGX_PANTRY_PATH for subsequent steps.
5+
6+
inputs:
7+
path:
8+
description: >
9+
Path to the brewkit checkout (containing projects/).
10+
Defaults to $GITHUB_WORKSPACE at runtime (safe for containers).
11+
required: false
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
repository: pkgxdev/pantry
19+
path: .upstream-pantry
20+
21+
- shell: bash
22+
env:
23+
INPUT_PATH: ${{inputs.path}}
24+
run: |
25+
dir="${INPUT_PATH:-$GITHUB_WORKSPACE}"
26+
cp -rn "$GITHUB_WORKSPACE/.upstream-pantry/projects/"* "$dir/projects/"
27+
rm -rf "$GITHUB_WORKSPACE/.upstream-pantry"
28+
echo "PKGX_PANTRY_DIR=$dir" >> "$GITHUB_ENV"
29+
echo "PKGX_PANTRY_PATH=$dir" >> "$GITHUB_ENV"

.github/workflows/ci.actions.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ jobs:
77
runs-on: ${{ matrix.platform.os }}
88
outputs:
99
pkg: ${{ steps.build.outputs.pkgjson }}
10-
env:
11-
PKGX_PANTRY_PATH: ${{github.workspace}}/co # v1
12-
PKGX_PANTRY_DIR: ${{github.workspace}}/co # v2
1310
strategy:
1411
matrix:
1512
platform:
@@ -22,9 +19,12 @@ jobs:
2219
steps:
2320
- uses: actions/checkout@v4
2421
with:
25-
path: co # test that things working isnt just a coincident of PWD == BREKWIT_DIR
22+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
2623

2724
- uses: pkgxdev/setup@v4
25+
- uses: ./co/.github/setup-pantry
26+
with:
27+
path: ${{github.workspace}}/co
2828

2929
- uses: ./co/build
3030
id: build
@@ -50,14 +50,14 @@ jobs:
5050
- darwin+aarch64
5151
- null
5252
runs-on: ubuntu-latest
53-
env:
54-
PKGX_PANTRY_PATH: ${{github.workspace}}/co
55-
PKGX_PANTRY_DIR: ${{github.workspace}}/co
5653
steps:
5754
- uses: actions/checkout@v4
5855
with:
59-
path: co # test that things working isnt just a coincident of PWD == BREKWIT_DIR
56+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
6057
- uses: pkgxdev/setup@v4
58+
- uses: ./co/.github/setup-pantry
59+
with:
60+
path: ${{github.workspace}}/co
6161
- uses: ./co/download-build-artifact
6262
with:
6363
pkg: ${{ needs.build.outputs.pkg }}
@@ -74,14 +74,14 @@ jobs:
7474
os:
7575
- ubuntu-latest
7676
- macos-latest
77-
env:
78-
PKGX_PANTRY_PATH: ${{github.workspace}}/co
79-
PKGX_PANTRY_DIR: ${{github.workspace}}/co
8077
steps:
8178
- uses: actions/checkout@v4
8279
with:
83-
path: co # test that things working isnt just a coincident of PWD == BREKWIT_DIR
80+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
8481
- uses: pkgxdev/setup@v4
82+
- uses: ./co/.github/setup-pantry
83+
with:
84+
path: ${{github.workspace}}/co
8585
- uses: ./co/download-build-artifact
8686
with:
8787
pkg: ${{ needs.build.outputs.pkg }}
@@ -98,15 +98,15 @@ jobs:
9898
platform:
9999
- darwin+aarch64
100100
- linux+x86-64
101-
env:
102-
PKGX_PANTRY_PATH: ${{github.workspace}}/co
103-
PKGX_PANTRY_DIR: ${{github.workspace}}/co
104101
steps:
105102
- uses: actions/checkout@v4
106103
with:
107-
path: co # test that things working isnt just a coincident of PWD == BREKWIT_DIR
104+
path: co # test that things working isn't just a coincident of PWD == BREKWIT_DIR
108105

109106
- uses: pkgxdev/setup@v4
107+
- uses: ./co/.github/setup-pantry
108+
with:
109+
path: ${{github.workspace}}/co
110110

111111
- uses: ./co/download-build-artifact
112112
id: dl
@@ -131,37 +131,30 @@ jobs:
131131
steps:
132132
- uses: actions/checkout@v4
133133
- uses: pkgxdev/setup@v4
134+
- uses: ./.github/setup-pantry
134135

135136
- uses: ./build
136137
id: build
137138
with:
138139
pkg: unavailable.com
139-
env:
140-
PKGX_PANTRY_PATH: ${{github.workspace}}
141-
PKGX_PANTRY_DIR: ${{github.workspace}}
142140

143141
- run: echo ${{steps.build.outputs.noop}}
144142

145143
- run: exit 1
146144
if: ${{steps.build.outputs.noop != 'true'}}
147145

148146
id:
149-
env:
150-
PKGX_PANTRY_PATH: ${{github.workspace}}
151-
PKGX_PANTRY_DIR: ${{github.workspace}}
152147
runs-on: ubuntu-latest
153148
outputs:
154149
pkgs: ${{ steps.id.outputs.pkgs }}
155150
steps:
156151
- uses: actions/checkout@v4
157152
- uses: pkgxdev/setup@v4
153+
- uses: ./.github/setup-pantry
158154
- uses: ./id
159155
id: id
160156
with:
161157
pkg: stark.com/foo
162-
env:
163-
PKGX_PANTRY_PATH: ${{github.workspace}}
164-
PKGX_PANTRY_DIR: ${{github.workspace}}
165158
- run: test ${{ steps.id.outputs.version }} = 2.3.4
166159
- run: test ${{ steps.id.outputs.version-raw }} = 2.3.4
167160
- run: test -z "${{ steps.id.outputs.version-tag }}"

.github/workflows/ci.cli.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44

55
env:
66
GITHUB_TOKEN: ${{github.token}}
7-
PKGX_PANTRY_PATH: ${{github.workspace}}
8-
PKGX_PANTRY_DIR: ${{github.workspace}}
97

108
jobs:
119
integration-tests:
@@ -36,9 +34,7 @@ jobs:
3634
steps:
3735
- uses: actions/checkout@v4
3836
- uses: pkgxdev/setup@v4
39-
40-
# otherwise, we're getting some weird race conditions on CI
41-
- run: pkgx --sync
37+
- uses: ./.github/setup-pantry
4238

4339
- run: bin/bk build ${{matrix.pkg}}
4440
- run: bin/bk test ${{matrix.pkg}}
@@ -49,6 +45,7 @@ jobs:
4945
steps:
5046
- uses: actions/checkout@v4
5147
- uses: pkgxdev/setup@v4
48+
- uses: ./.github/setup-pantry
5249
- uses: ./.github/modify-pantry
5350
- run: test $(bin/bk status) = stark.com/foo
5451
- run: bin/bk build
@@ -74,7 +71,7 @@ jobs:
7471
steps:
7572
- uses: actions/checkout@v4
7673
- uses: pkgxdev/setup@v4
77-
- run: pkgx --sync # FIXME PKGX_PANTRY_PATH causes auto sync to fail
74+
- uses: ./.github/setup-pantry
7875
- name: build
7976
run: |
8077
set +e

audit/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ inputs:
1414
runs:
1515
using: composite
1616
steps:
17-
- run: |
18-
if ! pkgx --sync; then
19-
echo "::error::you must use: pkgxdev/setup before using this action"
20-
exit 1
21-
fi
22-
shell: bash
23-
2417
- name: fetch deno deps
2518
shell: bash
2619
run: |

build/action.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ outputs:
3636
runs:
3737
using: composite
3838
steps:
39-
- name: prep
40-
run: |
41-
if ! pkgx --sync; then
42-
echo "::error::you must use: pkgxdev/setup before using this action"
43-
exit 1
44-
fi
45-
shell: bash
46-
4739
- name: fetch deno deps
4840
shell: bash
4941
run: |

download-build-artifact/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ outputs:
4141
runs:
4242
using: composite
4343
steps:
44-
- run: |
45-
if ! pkgx --sync; then
46-
echo "::error::you must use: pkgxdev/setup before using this action"
47-
exit 1
48-
fi
49-
shell: bash
50-
5144
- name: fetch deno deps
5245
shell: bash
5346
run: |

id/action.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
name:
2-
pkgx/brewkit/id
3-
description:
4-
resolve a specific version, including the raw version and tag (if available)
1+
name: pkgx/brewkit/id
2+
description: resolve a specific version, including the raw version and tag (if available)
53

64
inputs:
75
pkg:
@@ -28,14 +26,6 @@ outputs:
2826
runs:
2927
using: composite
3028
steps:
31-
- name: prep
32-
run: |
33-
if ! pkgx --sync; then
34-
echo "::error::you must use: pkgxdev/setup before using this action"
35-
exit 1
36-
fi
37-
shell: bash
38-
3929
- name: fetch deno deps
4030
run: |
4131
echo "::group::fetch deno deps"

test/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ inputs:
1212
runs:
1313
using: composite
1414
steps:
15-
- run: |
16-
if ! pkgx --sync; then
17-
echo "::error::you must use: pkgxdev/setup before using this action"
18-
exit 1
19-
fi
20-
shell: bash
21-
2215
- name: fetch deno deps
2316
shell: bash
2417
run: |

upload-build-artifact/action.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ inputs:
1313
runs:
1414
using: composite
1515
steps:
16-
- run: |
17-
if ! pkgx --sync; then
18-
echo "::error::you must use: pkgxdev/setup before using this action"
19-
exit 1
20-
fi
21-
shell: bash
22-
2316
- name: fetch deno deps
2417
shell: bash
2518
run: |

0 commit comments

Comments
 (0)