File tree 5 files changed +54
-3
lines changed
5 files changed +54
-3
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ jobs:
145
145
146
146
- name : pull the image
147
147
run : docker pull ${{ inputs.image_url || env.default_image }}
148
+
149
+ - name : run the Docker build locally using pulled image
150
+ run : TESTS=${{matrix.tests}} docker compose build ${{ env.container_name }}
151
+ env :
152
+ DOCKER_IMAGE_URL : ${{ inputs.image_url || env.default_image}}
148
153
149
154
- name : run the Docker tests
150
155
run : TESTS=${{matrix.tests}} docker compose up ${{ env.container_name }}
Original file line number Diff line number Diff line change
1
+ # use existing image, expect os to be the same
2
+ FROM ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest AS base
3
+
4
+ #
5
+ ENV PNPM_HOME="/pnpm"
6
+ ENV PATH="$PNPM_HOME:$PATH"
7
+ WORKDIR /app
8
+
9
+ # update the current code
10
+ ADD pnpm-lock.yaml pnpm-lock.yaml
11
+ ADD package.json package.json
12
+
13
+ # install
14
+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
15
+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
16
+ RUN pnpm install
17
+
18
+ WORKDIR /app
19
+
20
+ FROM base AS prod-deps
21
+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
22
+
23
+ FROM base AS build
24
+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
25
+
26
+ FROM base
27
+ COPY --from=prod-deps /app/node_modules /app/node_modules
28
+
Original file line number Diff line number Diff line change 1
1
unit-tests :
2
+ BUILDKIT_PROGRESS=plain TESTS=" /app/dist/node/lib/util/base58.unit-test.js" docker compose build unit-tests
3
+ BUILDKIT_PROGRESS=plain TESTS=" /app/dist/node/lib/util/base58.unit-test.js" docker compose up unit-tests
4
+
5
+ unit-tests-local :
2
6
BUILDKIT_PROGRESS=plain TESTS=" /app/dist/node/lib/util/base58.unit-test.js" docker compose build unit-tests-local
3
7
BUILDKIT_PROGRESS=plain TESTS=" /app/dist/node/lib/util/base58.unit-test.js" docker compose up unit-tests-local
4
8
Original file line number Diff line number Diff line change
1
+ # Goals and progress.
2
+
3
+ 1 . Integrate into existing build system
4
+ 2 . Have reproducible builds that work on localhost and also on github
5
+ 3 . Create useful reports that are published on github or availably locally
6
+ 4 . Create docker images for running and testing system
7
+ 5 . Run tests inside and outside of docker
8
+
1
9
# Perf report
2
10
3
11
The results of the job
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ services:
36
36
37
37
unit-tests :
38
38
restart : no
39
- image : ghcr.io/meta-introspector/o1js/o1js-perf-recording:latest
39
+ image : ghcr.io/meta-introspector/o1js/o1js-unit-tests:latest
40
+ build :
41
+ dockerfile : Dockerfile.unit_tests
40
42
privileged : true
41
43
environment :
42
44
- PROOF_LEVEL=full
@@ -46,13 +48,17 @@ services:
46
48
# mount the source
47
49
volumes :
48
50
- type : bind
49
- source : " /home/runner/work/o1js/o1js/ "
51
+ source : " . "
50
52
target : " /opt/introspector/test/"
53
+ - type : bind
54
+ source : " ."
55
+ target : " /app/"
51
56
cap_add :
52
57
- SYS_PTRACE
53
58
- SYS_ADMIN
59
+
54
60
# run the test from the mounted source
55
- command : " bash -x /opt/introspector/test/run-all-unit-tests.sh"
61
+ command : " bash -x /opt/introspector/test/run-all-unit-tests-local .sh"
56
62
57
63
unit-tests-local :
58
64
restart : no
You can’t perform that action at this time.
0 commit comments