[chore](trx-rs): shared SDK image for CI and developers #5
@@ -2,10 +2,11 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
# CI for the Docker-executor runner (VM). The lint/test jobs run inside the
|
# CI for the Docker-executor runner (VM). The lint, test and frontend jobs run
|
||||||
# shared trx-rs SDK image (container/Containerfile), which bakes in the pinned
|
# inside the shared trx-rs SDK image (container/Containerfile), which bakes in
|
||||||
# Rust toolchain and all build dependencies. The reuse job uses the upstream
|
# the pinned Rust toolchain, Node.js, Chromium and all build dependencies. The
|
||||||
# Docker action, which the Docker executor launches as a sibling container.
|
# reuse job uses the upstream Docker action, which the Docker executor launches
|
||||||
|
# as a sibling container.
|
||||||
|
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
@@ -53,6 +54,7 @@ jobs:
|
|||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container: git.haxx.space/sjg/trx-rs/sdk:latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: src/trx-client/trx-frontend/trx-frontend-http/frontend
|
working-directory: src/trx-client/trx-frontend/trx-frontend-http/frontend
|
||||||
@@ -73,15 +75,12 @@ jobs:
|
|||||||
run: npm run lint
|
run: npm run lint
|
||||||
- name: Test
|
- name: Test
|
||||||
run: npm test
|
run: npm test
|
||||||
- name: Install browser smoke dependency
|
# Chromium comes from the SDK image at the path the smoke test defaults
|
||||||
run: command -v chromium >/dev/null || (sudo apt-get update && sudo apt-get install -y --no-install-recommends chromium)
|
# to, so there is nothing to install here.
|
||||||
- name: Browser smoke test
|
- name: Browser smoke test
|
||||||
run: npm run test:browser
|
run: npm run test:browser
|
||||||
- name: Verify generated assets
|
- name: Verify generated assets
|
||||||
run: npm run verify-generated
|
run: npm run verify-generated
|
||||||
- name: Verify generated-file licensing
|
|
||||||
working-directory: .
|
|
||||||
run: reuse lint
|
|
||||||
|
|
||||||
reuse:
|
reuse:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
+9
-3
@@ -48,11 +48,17 @@ Building outside the container? `rust-toolchain.toml` pins the same rustc, so
|
|||||||
|
|
||||||
## CI use
|
## CI use
|
||||||
|
|
||||||
`.gitea/workflows/ci.yml` runs the `lint` and `test` jobs *inside* this image
|
`.gitea/workflows/ci.yml` runs the `lint`, `test` and `frontend` jobs *inside*
|
||||||
via the `container:` key, so they skip all setup and go straight to `cargo`.
|
this image via the `container:` key, so they skip all setup and go straight to
|
||||||
|
`cargo` and `npm`. The frontend job needs three things from the image beyond
|
||||||
|
Rust: Node.js for the toolchain, Chromium at `/usr/bin/chromium` for the
|
||||||
|
browser smoke test, and `cargo` — `npm run verify-generated` regenerates the
|
||||||
|
Rust wire contracts before checking for drift.
|
||||||
|
|
||||||
The `reuse` job stays on the upstream `fsfe/reuse-action` (a Docker action the
|
The `reuse` job stays on the upstream `fsfe/reuse-action` (a Docker action the
|
||||||
Docker executor launches as a sibling container) — nothing REUSE-related is
|
Docker executor launches as a sibling container) — nothing REUSE-related is
|
||||||
baked into the SDK.
|
baked into the SDK, and it lints the whole repository, so no job runs its own
|
||||||
|
licence check.
|
||||||
|
|
||||||
## Compilation cache (sccache)
|
## Compilation cache (sccache)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user