File tree Expand file tree Collapse file tree 4 files changed +62
-1
lines changed
Expand file tree Collapse file tree 4 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Build test models
2+
3+ on :
4+ push :
5+ branches :
6+ - ' **'
7+
8+ permissions :
9+ contents : write
10+ packages : write
11+ checks : write
12+ attestations : write
13+ id-token : write
14+
15+ env :
16+ REGISTRY : ghcr.io
17+ IMAGE_NAME : ${{ github.repository }}
18+
19+ jobs :
20+ build :
21+ name : build test model
22+ runs-on : ubuntu-latest
23+ env :
24+ CI : true
25+ steps :
26+ - name : Set up Go
27+ uses : actions/setup-go@v2
28+ with :
29+ go-version : ' 1.24.5'
30+ - name : Checkout code
31+ uses : actions/checkout@v4
32+ - name : Install dependencies
33+ run : |
34+ go mod download
35+ - name : download models
36+ run : |
37+ go run testData/downloadModels.go
38+ - name : List models directory
39+ run : ls -l ./models
40+ - name : Remove models from .dockerignore # make sure models folder is not ignored
41+ run : sed -i '/^\\/models$/d' .dockerignore
42+ - name : Log in to the Container registry
43+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
44+ with :
45+ registry : ${{ env.REGISTRY }}
46+ username : ${{ github.actor }}
47+ password : ${{ secrets.GITHUB_TOKEN }}
48+ - name : Build and push Docker image
49+ uses : docker/build-push-action@v5
50+ with :
51+ context : .
52+ file : models.Dockerfile
53+ tags : ghcr.io/knights-analytics/hugot/models:latest
54+ push : true
Original file line number Diff line number Diff line change 1+ FROM scratch
2+
3+ COPY models .
Original file line number Diff line number Diff line change 3030fi
3131
3232# build with compose
33- docker compose -f " $src_dir /compose-test.yaml" build
33+ docker compose -f " $src_dir /compose-test.yaml" build hugot && \
34+ docker compose -f " $src_dir /compose-test.yaml" build-test
3435
3536echo " Running tests for commit hash: $commit_hash "
3637docker compose -f " $src_dir /compose-test.yaml" up && \
Original file line number Diff line number Diff line change 11ARG BUILD_PLATFORM=linux/amd64
22
3+ FROM ghcr.io/knights-analytics/hugot/models:latest AS models
4+
35FROM --platform=$BUILD_PLATFORM hugot:latest AS hugot-test
46
57COPY . /build
8+ COPY --from=models /models /build/models
69
710RUN cd /build && \
811 chown -R testuser:testuser /build && \
You can’t perform that action at this time.
0 commit comments