Skip to content

Commit dbd01a4

Browse files
committed
fix: github actions cross compile
1 parent 32946e9 commit dbd01a4

3 files changed

Lines changed: 15 additions & 81 deletions

File tree

.github/workflows/build.yaml

Lines changed: 9 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,8 @@ jobs:
1919
contents: read
2020
attestations: write
2121
packages: write
22-
runs-on: ${{ matrix.runs-on }}
23-
strategy:
24-
matrix:
25-
include:
26-
- runs-on: ubuntu-24.04
27-
platform: linux/amd64
28-
- runs-on: ubuntu-24.04-arm
29-
platform: linux/arm64
22+
runs-on: ubuntu-24.04
3023
steps:
31-
- name: Prepare
32-
run: |
33-
platform=${{ matrix.platform }}
34-
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
35-
3624
- name: Docker meta
3725
id: meta
3826
uses: docker/metadata-action@v5
@@ -50,6 +38,8 @@ jobs:
5038
registry: ${{ env.REGISTRY }}
5139
username: "${{ github.repository_owner }}"
5240
password: "${{ secrets.GITHUB_TOKEN }}"
41+
- name: Set up QEMU
42+
uses: docker/setup-qemu-action@v3
5343
- name: Setup Docker Buildx
5444
id: buildx
5545
uses: docker/setup-buildx-action@v3
@@ -62,7 +52,6 @@ jobs:
6252
${{ runner.os }}-buildx-
6353
- name: Set sync_version from deno.json
6454
run: |
65-
platform=${{ matrix.platform }}
6655
sync_version=$(jq -r '.version' deno.json)
6756
echo "sync_version=${sync_version}" >> $GITHUB_ENV
6857
- name: Build and push @query-doctor/sync
@@ -74,7 +63,7 @@ jobs:
7463
builder: ${{ steps.buildx.outputs.name }}
7564
push: ${{ github.event_name == 'push' }}
7665
outputs: type=docker
77-
platforms: ${{ matrix.platform }}
66+
platforms: linux/amd64,linux/arm64
7867
tags: ${{ steps.meta.outputs.tags }}
7968
cache-from: type=local,src=/tmp/.buildx-cache
8069
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
@@ -93,68 +82,9 @@ jobs:
9382
mkdir -p ${{ runner.temp }}/digests
9483
digest="${{ steps.build.outputs.digest }}"
9584
touch "${{ runner.temp }}/digests/${digest#sha256:}"
96-
- name: Upload digest
97-
uses: actions/upload-artifact@v4
98-
if: ${{ github.event_name == 'push' }}
99-
with:
100-
name: digests-${{ env.PLATFORM_PAIR }}
101-
path: ${{ runner.temp }}/digests/*
102-
if-no-files-found: error
103-
retention-days: 1
104-
105-
# TODO: Attest is not working for some reason
106-
# - name: Attest
107-
# uses: actions/attest-build-provenance@v2
108-
# with:
109-
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
110-
# subject-digest: ${{ steps.build.outputs.digest }}
111-
# push-to-registry: true
112-
113-
merge:
114-
runs-on: ubuntu-24.04
115-
if: ${{ github.event_name == 'push' }}
116-
permissions:
117-
id-token: write
118-
contents: read
119-
attestations: write
120-
packages: write
121-
needs:
122-
- build
123-
steps:
124-
- name: Download digests
125-
uses: actions/download-artifact@v4
126-
with:
127-
path: ${{ runner.temp }}/digests
128-
pattern: digests-*
129-
merge-multiple: true
130-
131-
- name: Login to ghcr
132-
uses: docker/login-action@v3
85+
- name: Attest
86+
uses: actions/attest-build-provenance@v2
13387
with:
134-
registry: ${{ env.REGISTRY }}
135-
username: "${{ github.actor }}"
136-
password: "${{ secrets.GITHUB_TOKEN }}"
137-
138-
- name: Set up Docker Buildx
139-
uses: docker/setup-buildx-action@v3
140-
141-
- name: Docker meta
142-
id: meta
143-
uses: docker/metadata-action@v5
144-
with:
145-
images: ${{ env.IMAGE_NAME }}
146-
tags: |
147-
type=ref,event=branch
148-
type=ref,event=pr
149-
type=semver,pattern={{version}}
150-
type=semver,pattern={{major}}.{{minor}}
151-
152-
- name: Create manifest list and push
153-
working-directory: ${{ runner.temp }}/digests
154-
run: |
155-
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
156-
$(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *)
157-
158-
- name: Inspect image
159-
run: |
160-
docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
88+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
89+
subject-digest: ${{ steps.build.outputs.digest }}
90+
push-to-registry: true

src/sync/syncer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export type SyncResult =
6060
sampledRecords: Record<string, number>;
6161
notices: SyncNotice[];
6262
queries: RecentQueries;
63-
// metadata: TableMetadata[];
63+
metadata: TableMetadata[];
6464
}
6565
| PostgresConnectionError
6666
| PostgresError
@@ -199,7 +199,7 @@ export class PostgresSyncer {
199199
notices,
200200
queries,
201201
setup: wrapped,
202-
metadata: serializedResult.serialized,
202+
metadata: serializedResult.schema,
203203
};
204204
}
205205

test/main_test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ function testDb(): DatabaseConnector<{
2525
dependencies() {
2626
return Promise.resolve([
2727
{
28+
sourceSchema: "public",
2829
sourceTable: "posts",
2930
sourceColumn: ["poster_id"],
31+
referencedSchema: "public",
3032
referencedTable: "users",
3133
referencedColumn: ["id"],
3234
},
3335
{
36+
sourceSchema: "public",
3437
sourceTable: "users",
3538
sourceColumn: null,
39+
referencedSchema: null,
3640
referencedTable: null,
3741
referencedColumn: null,
3842
},

0 commit comments

Comments
 (0)