Skip to content

Commit afec45a

Browse files
committed
build release outside docker
1 parent 5e9fc82 commit afec45a

8 files changed

+300
-62
lines changed

.github/workflows/build-images.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ jobs:
4747

4848
- name: Build Docker Images
4949
run: |
50-
./.maintain/build-image.sh build
50+
cargo build --locked --release --features default
51+
docker build -t kilt-node .
52+
5153
5254
- name: Push Image - Commit SHA
5355
if: github.ref_type == 'branch'

.github/workflows/cargo-clippy.yml

-45
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Check Clippy all-features
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
get-head-commit-msg:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
16+
- name: Get Head Commit Message
17+
id: step-head-commit
18+
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
19+
20+
check-clippy-all-features:
21+
runs-on: ubuntu-latest
22+
needs: get-head-commit-msg
23+
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }}
24+
steps:
25+
- name: Free Disk Space
26+
uses: jlumbroso/free-disk-space@main
27+
with:
28+
tool-cache: true
29+
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Cargo Cache
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.cargo/bin/
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
key: $ ${{ github.job }}-${{ github.ref }}-clippy-all-features-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
$ ${{ github.job }}-${{ github.ref }}-clippy-all-features-
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Run Clippy
49+
run: |
50+
docker run --rm \
51+
-v "${GITHUB_WORKSPACE}:/workspace" \
52+
-v "${HOME}/.cargo:/root/.cargo" \
53+
-w /workspace \
54+
-e RUSTDOCFLAGS='-D warnings' \
55+
-e SKIP_WASM_BUILD=1 \
56+
paritytech/ci-unified:bullseye-1.74.0 \
57+
bash -c "
58+
cargo clippy --all-targets --all-features --locked --quiet && \
59+
chown -R $(id -u):$(id -g) target/"
60+

.github/workflows/check-clippy.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Check Clippy
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
get-head-commit-msg:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
16+
- name: Get Head Commit Message
17+
id: step-head-commit
18+
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
19+
20+
check-clippy:
21+
runs-on: ubuntu-latest
22+
needs: get-head-commit-msg
23+
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }}
24+
steps:
25+
- name: Free Disk Space
26+
uses: jlumbroso/free-disk-space@main
27+
with:
28+
tool-cache: true
29+
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Cargo Cache
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.cargo/bin/
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
key: $ ${{ github.job }}-${{ github.ref }}-clippy-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
$ ${{ github.job }}-${{ github.ref }}-clippy-
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Run Clippy
49+
run: |
50+
docker run --rm \
51+
-v "${GITHUB_WORKSPACE}:/workspace" \
52+
-v "${HOME}/.cargo:/root/.cargo" \
53+
-w /workspace \
54+
-e RUSTDOCFLAGS='-D warnings' \
55+
-e SKIP_WASM_BUILD=1 \
56+
paritytech/ci-unified:bullseye-1.74.0 \
57+
bash -c "
58+
cargo clippy --all-targets --locked --quiet && \
59+
chown -R $(id -u):$(id -g) target/"

.github/workflows/check-rustdoc.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Cargo Clippy
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
get-head-commit-msg:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
16+
- name: Get Head Commit Message
17+
id: step-head-commit
18+
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
19+
20+
check-clippy:
21+
runs-on: ubuntu-latest
22+
needs: get-head-commit-msg
23+
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }}
24+
steps:
25+
- name: Free Disk Space
26+
uses: jlumbroso/free-disk-space@main
27+
with:
28+
tool-cache: true
29+
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Cargo Cache
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.cargo/bin/
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
key: $ ${{ github.job }}-${{ github.ref }}-rustdoc-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
$ ${{ github.job }}-${{ github.ref }}-rustdoc-
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Run doc
49+
run: |
50+
docker run --rm \
51+
-v "${GITHUB_WORKSPACE}:/workspace" \
52+
-v "${HOME}/.cargo:/root/.cargo" \
53+
-w /workspace \
54+
-e RUSTDOCFLAGS='-D warnings' \
55+
-e SKIP_WASM_BUILD=1 \
56+
paritytech/ci-unified:bullseye-1.74.0 \
57+
bash -c "
58+
cargo doc --all-features --no-deps --locked && \
59+
chown -R $(id -u):$(id -g) target/"
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Check Clippy
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
get-head-commit-msg:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
16+
- name: Get Head Commit Message
17+
id: step-head-commit
18+
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
19+
20+
check-clippy:
21+
runs-on: ubuntu-latest
22+
needs: get-head-commit-msg
23+
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }}
24+
steps:
25+
- name: Free Disk Space
26+
uses: jlumbroso/free-disk-space@main
27+
with:
28+
tool-cache: true
29+
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Cargo Cache
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.cargo/bin/
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
key: $ ${{ github.job }}-${{ github.ref }}-clippy-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
$ ${{ github.job }}-${{ github.ref }}-clippy-
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Run Clippy
49+
run: |
50+
docker run --rm \
51+
-v "${GITHUB_WORKSPACE}:/workspace" \
52+
-v "${HOME}/.cargo:/root/.cargo" \
53+
-w /workspace \
54+
-e RUSTDOCFLAGS='-D warnings' \
55+
-e SKIP_WASM_BUILD=1 \
56+
paritytech/ci-unified:bullseye-1.74.0 \
57+
bash -c "
58+
cargo test --all-features --all-targets --locked && \
59+
chown -R $(id -u):$(id -g) target/"

.github/workflows/test.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Check Clippy
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
get-head-commit-msg:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
16+
- name: Get Head Commit Message
17+
id: step-head-commit
18+
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
19+
20+
check-clippy:
21+
runs-on: ubuntu-latest
22+
needs: get-head-commit-msg
23+
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }}
24+
steps:
25+
- name: Free Disk Space
26+
uses: jlumbroso/free-disk-space@main
27+
with:
28+
tool-cache: true
29+
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Cargo Cache
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.cargo/bin/
38+
~/.cargo/registry/index/
39+
~/.cargo/registry/cache/
40+
~/.cargo/git/db/
41+
key: $ ${{ github.job }}-${{ github.ref }}-clippy-${{ hashFiles('**/Cargo.lock') }}
42+
restore-keys: |
43+
$ ${{ github.job }}-${{ github.ref }}-clippy-
44+
45+
- name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v3
47+
48+
- name: Run Clippy
49+
run: |
50+
docker run --rm \
51+
-v "${GITHUB_WORKSPACE}:/workspace" \
52+
-v "${HOME}/.cargo:/root/.cargo" \
53+
-w /workspace \
54+
-e RUSTDOCFLAGS='-D warnings' \
55+
-e SKIP_WASM_BUILD=1 \
56+
paritytech/ci-unified:bullseye-1.74.0 \
57+
bash -c "
58+
cargo test --all-targets --locked && \
59+
chown -R $(id -u):$(id -g) target/"

Dockerfile

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
1-
# this container builds the kilt-parachain binary from source files and the runtime library
2-
# pinned the version to avoid build cache invalidation
3-
4-
FROM paritytech/ci-unified:bullseye-1.70.0 as builder
5-
6-
WORKDIR /build
7-
8-
ARG FEATURES=default
9-
10-
COPY . .
11-
12-
RUN cargo build --locked --release --features $FEATURES
13-
14-
# ===== SECOND STAGE ======
15-
161
FROM docker.io/library/ubuntu:20.04
172
LABEL description="This is the 2nd stage: a very small image where we copy the kilt-parachain binary."
183

194
ARG NODE_TYPE=kilt-parachain
205

21-
COPY --from=builder /build/target/release/$NODE_TYPE /usr/local/bin/node-executable
6+
COPY ./target/release/$NODE_TYPE /usr/local/bin/node-executable
227

238
RUN useradd -m -u 1000 -U -s /bin/sh -d /node node && \
249
mkdir -p /node/.local/share/node && \

0 commit comments

Comments
 (0)