Skip to content

Commit 525a878

Browse files
authored
Build native image once (#12948)
- close #12845 - close #12123 - close #12991 This PR updates GitHub workflows to build the Engine Distribution once per platform and then reuse it in the subsequent jobs Changelog: - update: [Engine Pull Request](https://github.com/enso-org/enso/actions/runs/14802670113) workflow to build the Engine distribution once - update: [Engine Nightly Checks](https://github.com/enso-org/enso/actions/runs/14803521396) workflow to build Engine distribution once - update: [Extra Nightly Tests](https://github.com/enso-org/enso/actions/runs/14802077726) workflow to build Engine distribution once - update: [IDE Packaging](https://github.com/enso-org/enso/actions/runs/14802670102?pr=12948) workflow to build the native engine distribution - update: run stdlib tests once in native mode and once jvm mode by passing the `--jvm` flag - update: set verbose parameter in the `NativeImage` builder when running on CI - update: disable `Examples_Tests`. Fail in both [native](https://github.com/enso-org/enso/actions/runs/14673697679/job/41186315761#step:12:1543) and [jvm](https://github.com/enso-org/enso/actions/runs/14673697679/job/41186315099#step:12:1379) modes on linux - fix: wait for [HTTP server to start](https://github.com/enso-org/enso/actions/runs/14693988933/job/41233617675#step:12:1240) before running stdlib tests - fix: `engine-common` tests to depend on the `edition-updater` to avoid [arbitrary failures](https://github.com/enso-org/enso/actions/runs/14733873659/job/41355858655#step:13:2407) # Important Notes :heavy_check_mark: [Nightly release](https://github.com/enso-org/enso/actions/runs/14809439715) manually checked that linux build works :heavy_check_mark: [Extra Nightly Tests](https://github.com/enso-org/enso/actions/runs/14802077726) :heavy_check_mark: [Engine Nightly Checks](https://github.com/enso-org/enso/actions/runs/14803521396)
1 parent 05efed3 commit 525a878

File tree

19 files changed

+1751
-441
lines changed

19 files changed

+1751
-441
lines changed

.github/workflows/engine-checks-nightly.yml

Lines changed: 690 additions & 25 deletions
Large diffs are not rendered by default.

.github/workflows/engine-checks-optional.yml

Lines changed: 114 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}-engine-checks-optional
1616
cancel-in-progress: ${{ github.ref != 'refs/heads/develop' }}
1717
jobs:
18-
enso-build-ci-gen-job-ci-check-backend-graal-vm-ce-macos-amd64:
19-
name: Engine (GraalVM CE) (macos, amd64)
18+
enso-build-ci-gen-job-build-engine-distribution-graal-vm-ce-macos-amd64:
19+
name: Build Engine Distribution (GraalVM CE) (native,test) (macos, amd64)
2020
runs-on:
2121
- macos-13
22-
continue-on-error: true
2322
steps:
2423
- if: runner.os == 'Windows'
2524
name: Setup required bazel environment
@@ -54,18 +53,30 @@ jobs:
5453
run: ./run git-clean
5554
env:
5655
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
- run: ./run backend ci-check
56+
- run: ./run backend ci-build-engine-distribution
5857
env:
5958
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
- name: Archive Engine Distribution
60+
run: tar -cvf built-distribution.tar built-distribution test
61+
- name: Upload Engine Distribution
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: Engine Distribution (GraalVM CE) (native,test) (macos, amd64)
65+
path: built-distribution.tar
66+
- name: Cleanup Archive
67+
run: rm built-distribution.tar
6068
- if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || (github.ref == 'refs/heads/develop') || inputs.clean_build_required)"
6169
name: Clean after
6270
run: ./run git-clean
6371
env:
6472
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6573
env:
74+
ENSO_LAUNCHER: native,test
6675
GRAAL_EDITION: GraalVM CE
6776
enso-build-ci-gen-job-jvm-tests-graal-vm-ce-macos-amd64:
6877
name: JVM Tests (GraalVM CE) (macos, amd64)
78+
needs:
79+
- enso-build-ci-gen-job-build-engine-distribution-graal-vm-ce-macos-amd64
6980
runs-on:
7081
- macos-13
7182
continue-on-error: true
@@ -103,6 +114,16 @@ jobs:
103114
run: ./run git-clean
104115
env:
105116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
- run: rm -rf built-distribution test
118+
shell: bash
119+
- name: Download Engine Distribution
120+
uses: actions/download-artifact@v4
121+
with:
122+
name: Engine Distribution (GraalVM CE) (native,test) (macos, amd64)
123+
- name: Unpack Engine Distribution
124+
run: |
125+
tar -xvf built-distribution.tar
126+
rm built-distribution.tar
106127
- run: ./run backend test jvm
107128
env:
108129
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -124,8 +145,10 @@ jobs:
124145
GRAAL_EDITION: GraalVM CE
125146
permissions:
126147
checks: write
127-
enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-macos-amd64:
128-
name: Standard Library Tests (GraalVM CE) (macos, amd64)
148+
enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-jvm-macos-amd64:
149+
name: Standard Library Tests (GraalVM CE) (jvm) (macos, amd64)
150+
needs:
151+
- enso-build-ci-gen-job-build-engine-distribution-graal-vm-ce-macos-amd64
129152
runs-on:
130153
- macos-13
131154
continue-on-error: true
@@ -163,6 +186,16 @@ jobs:
163186
run: ./run git-clean
164187
env:
165188
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
189+
- run: rm -rf built-distribution test
190+
shell: bash
191+
- name: Download Engine Distribution
192+
uses: actions/download-artifact@v4
193+
with:
194+
name: Engine Distribution (GraalVM CE) (native,test) (macos, amd64)
195+
- name: Unpack Engine Distribution
196+
run: |
197+
tar -xvf built-distribution.tar
198+
rm built-distribution.tar
166199
- run: ./run backend test standard-library
167200
env:
168201
ENSO_LIB_S3_AWS_ACCESS_KEY_ID: ${{ secrets.ENSO_LIB_S3_AWS_ACCESS_KEY_ID }}
@@ -187,5 +220,80 @@ jobs:
187220
GRAAL_EDITION: GraalVM CE
188221
permissions:
189222
checks: write
223+
enso-build-ci-gen-job-standard-library-tests-graal-vm-ce-native-macos-amd64:
224+
name: Standard Library Tests (GraalVM CE) (native) (macos, amd64)
225+
needs:
226+
- enso-build-ci-gen-job-build-engine-distribution-graal-vm-ce-macos-amd64
227+
runs-on:
228+
- macos-13
229+
continue-on-error: true
230+
steps:
231+
- if: runner.os == 'Windows'
232+
name: Setup required bazel environment
233+
run: "\n\"BAZEL_SH=C:\\Program Files\\Git\\bin\\bash.exe\" >> $env:GITHUB_ENV\n\"BAZEL_VC=C:\\BuildTools\\VC\" >> $env:GITHUB_ENV\n "
234+
shell: pwsh
235+
- name: Setup bazel environment
236+
uses: bazel-contrib/setup-bazel@0.13.0
237+
with:
238+
bazelrc: build --remote_cache=grpcs://${{ vars.ENSO_BAZEL_CACHE_URI }} --remote_cache_header="authorization=Basic ${{ secrets.ENSO_BAZEL_CACHE_TOKEN }}"
239+
output-base: ${{ runner.os == 'Windows' && 'c:/_bazel' || '' }}
240+
- name: Expose Artifact API and context information.
241+
uses: actions/github-script@v7
242+
with:
243+
script: "\n core.exportVariable(\"ACTIONS_RUNTIME_TOKEN\", process.env[\"ACTIONS_RUNTIME_TOKEN\"])\n core.exportVariable(\"ACTIONS_RUNTIME_URL\", process.env[\"ACTIONS_RUNTIME_URL\"])\n core.exportVariable(\"GITHUB_RETENTION_DAYS\", process.env[\"GITHUB_RETENTION_DAYS\"])\n console.log(context)\n "
244+
- name: Checking out the repository
245+
uses: actions/checkout@v4
246+
with:
247+
clean: false
248+
- if: runner.os == 'macOS'
249+
name: Setup nodejs version
250+
uses: actions/setup-node@v4
251+
with:
252+
node-version-file: .node-version
253+
- if: runner.os != 'Linux'
254+
run: npm install -g corepack@0.31.0 && corepack --version
255+
- name: Build Script Setup
256+
run: ./run --help || (git clean -ffdx && ./run --help)
257+
env:
258+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
259+
- if: "(contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || (github.ref == 'refs/heads/develop') || inputs.clean_build_required)"
260+
name: Clean before
261+
run: ./run git-clean
262+
env:
263+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
264+
- run: rm -rf built-distribution test
265+
shell: bash
266+
- name: Download Engine Distribution
267+
uses: actions/download-artifact@v4
268+
with:
269+
name: Engine Distribution (GraalVM CE) (native,test) (macos, amd64)
270+
- name: Unpack Engine Distribution
271+
run: |
272+
tar -xvf built-distribution.tar
273+
rm built-distribution.tar
274+
- run: ./run backend test standard-library-in-native
275+
env:
276+
ENSO_LIB_S3_AWS_ACCESS_KEY_ID: ${{ secrets.ENSO_LIB_S3_AWS_ACCESS_KEY_ID }}
277+
ENSO_LIB_S3_AWS_REGION: ${{ secrets.ENSO_LIB_S3_AWS_REGION }}
278+
ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY: ${{ secrets.ENSO_LIB_S3_AWS_SECRET_ACCESS_KEY }}
279+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
280+
- if: (success() || failure()) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
281+
name: Standard Library Test Reporter
282+
uses: dorny/test-reporter@v1
283+
with:
284+
max-annotations: 50
285+
name: Standard Library Tests Report (GraalVM CE, macos, amd64)
286+
path: ${{ env.ENSO_TEST_JUNIT_DIR }}/*/*.xml
287+
path-replace-backslashes: true
288+
reporter: java-junit
289+
- if: "(always()) && (contains(github.event.pull_request.labels.*.name, 'CI: Clean build required') || (github.ref == 'refs/heads/develop') || inputs.clean_build_required)"
290+
name: Clean after
291+
run: ./run git-clean
292+
env:
293+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
294+
env:
295+
GRAAL_EDITION: GraalVM CE
296+
permissions:
297+
checks: write
190298
env:
191299
ENSO_BUILD_SKIP_VERSION_CHECK: "true"

0 commit comments

Comments
 (0)