Repository navigation
177 lines (171 loc) · 6.35 KB
/
Copy pathci.yml
File metadata and controls
177 lines (171 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- run: bun install --frozen-lockfile
- run: bun run typecheck
- run: bun run test:native-worker
- run: bun run test
- run: bun x playwright install --with-deps chromium
- run: bun run test:mcp-ui
- name: Test configured browser plugin in workerd
run: |
ARTIFACTS_PLUGINS_CONFIG=src/test/plugins/config.ts bun run build:cloudflare-compiler
ARTIFACTS_PLUGIN_TEST=1 bun test cloudflare/compiler.test.ts --test-name-pattern 'deployment browser plugin' --timeout 60000
# Rebuild the default deployment before the normal runtime and package checks.
- run: bun run test:cloudflare
- run: bun run typecheck:cloudflare
- name: Install celld 0.6.1
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download v0.6.1 --repo denoland/celld --pattern celld-x86_64-unknown-linux-gnu.gz --dir "$RUNNER_TEMP"
gzip -d "$RUNNER_TEMP/celld-x86_64-unknown-linux-gnu.gz"
chmod +x "$RUNNER_TEMP/celld-x86_64-unknown-linux-gnu"
echo "CELLD_BIN=$RUNNER_TEMP/celld-x86_64-unknown-linux-gnu" >> "$GITHUB_ENV"
- run: CELLD_PACKAGE_INTEGRATION=1 bun run test:package:prebuilt
- run: bun run test:celld
- run: NATIVE_WORKER_CELLD=1 bun test scripts/native-worker cloudflare/native-worker.test.ts --timeout 180000
- name: Test native Worker apps on a two-node celld fleet
run: |
docker run --rm -d --name artifacts-fleet-test-s3 -p 127.0.0.1:5117:9000 \
-e MINIO_ROOT_USER=artifacts-fixture -e MINIO_ROOT_PASSWORD=artifacts-fixture-secret \
cgr.dev/chainguard/minio:latest server /data --address :9000
trap 'docker stop artifacts-fleet-test-s3' EXIT
NATIVE_WORKER_FLEET=1 bun test scripts/native-worker/fleet.test.ts --timeout 240000
- name: Test the nine-tool MCP connection and inline previews
run: bun run test:mcp-discovery
executable:
strategy:
fail-fast: false
matrix:
os: [macos-15, ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- run: bun install --frozen-lockfile
- run: bun run build:executable
- run: bun test scripts/executable.integration.test.ts --timeout 180000
- uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.os }}
path: dist/binaries/*
if-no-files-found: error
docker-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
platform: linux/amd64
arch: amd64
- os: ubuntu-24.04-arm
platform: linux/arm64
arch: arm64
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.4.0
- run: bun install --frozen-lockfile
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
load: true
tags: artifacts:test
cache-from: type=gha,scope=docker-${{ matrix.arch }}
cache-to: type=gha,scope=docker-${{ matrix.arch }},mode=max
- name: Test compilation, persistence, and graceful shutdown
env:
ARTIFACTS_DOCKER_IMAGE: artifacts:test
run: bun test scripts/docker.integration.test.ts --timeout 240000
- name: Build fleet publisher
uses: docker/build-push-action@v6
with:
context: .
target: fleet-operator
platforms: ${{ matrix.platform }}
load: true
tags: artifacts:fleet-test
cache-from: type=gha,scope=docker-${{ matrix.arch }}
- name: Test authenticated host release command
env:
FLEET_OPERATOR_DOCKER_IMAGE: artifacts:fleet-test
run: bun test scripts/native-worker/fleet-image.test.ts --timeout 30000
docker-publish:
needs: [check, executable, docker-test]
if: github.repository == 'sidequery/artifacts' && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- target: runtime
prefix: ""
- target: fleet-operator
prefix: fleet-
timeout-minutes: 30
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: metadata
with:
images: ghcr.io/sidequery/artifacts
flavor: prefix=${{ matrix.prefix }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=long,prefix=${{ matrix.prefix }}sha-
type=ref,event=tag
- uses: docker/build-push-action@v6
with:
context: .
target: ${{ matrix.target }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: |
type=gha,scope=docker-amd64
type=gha,scope=docker-arm64
- name: Verify anonymous access
env:
IMAGE: ghcr.io/sidequery/artifacts:${{ matrix.prefix }}sha-${{ github.sha }}
run: |
mkdir -p "$RUNNER_TEMP/public-docker"
docker --config "$RUNNER_TEMP/public-docker" manifest inspect "$IMAGE" > /dev/null || {
echo 'Set the artifacts container package visibility to Public in GitHub package settings, then rerun this job.' >&2
exit 1
}