Skip to content

Commit 790004f

Browse files
committed
get commit message in a step
1 parent 836ca94 commit 790004f

12 files changed

+143
-328
lines changed

.github/workflows/check-clippy-all-features.yml

-58
This file was deleted.

.github/workflows/check-clippy.yml

+34-39
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,52 @@
1-
name: Check Clippy
1+
name: Clippy-checks
22

33
on:
44
pull_request:
5+
push:
6+
branches:
7+
- develop
8+
- master
9+
- 'refs/tags/[0-9]+.[0-9]+.[0-9]+*'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
RUSTDOCFLAGS: '-D warnings'
517

618
jobs:
7-
get-head-commit-msg:
19+
clippy:
20+
name: Run Clippy with different features combinations
821
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 }}
1522

16-
- name: Get Head Commit Message
17-
id: step-head-commit
18-
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
23+
strategy:
24+
matrix:
25+
features:
26+
-
27+
- --all-features
1928

20-
cargo-test-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') }}
2429
steps:
25-
- name: Free Disk Space
26-
uses: jlumbroso/free-disk-space@main
27-
with:
28-
tool-cache: true
29-
30-
- name: Checkout
30+
- name: Download repository
3131
uses: actions/checkout@v4
3232

33-
- name: Set up Cargo Cache
33+
- name: Set up Rust toolchain
34+
uses: actions-rust-lang/setup-rust-toolchain@v1
35+
36+
- name: Set up cargo cache
3437
uses: actions/cache@v4
3538
with:
3639
path: |
3740
~/.cargo/bin/
3841
~/.cargo/registry/index/
3942
~/.cargo/registry/cache/
4043
~/.cargo/git/db/
41-
key: $ ${{ github.job }}-${{ github.ref_name }}-clippy-${{ hashFiles('**/Cargo.lock') }}
42-
restore-keys: |
43-
$ ${{ github.job }}-${{ github.ref_name }}-clippy-
44-
45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v3
47-
48-
- name: Run Test
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 "cargo clippy --all-targets --locked --quiet"
44+
target/
45+
key: ${{ github.job }}-${{ github.ref }}-${{ matrix.features }}-cargo-cache
46+
47+
- name: Run Clippy with "${{ matrix.features }}"
48+
run: cargo clippy --all-targets --locked ${{ matrix.features }}
49+
50+
51+
52+

.github/workflows/check-fmt.yml

+7-11
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,26 @@ concurrency:
88
cancel-in-progress: true
99

1010
jobs:
11-
get-head-commit-msg:
11+
check-fmt:
1212
runs-on: ubuntu-latest
1313
outputs:
1414
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
15+
container:
16+
image: paritytech/ci-unified:bullseye-1.74.0
1517
steps:
16-
- uses: actions/checkout@v4
18+
- name: Checkout
19+
uses: actions/checkout@v4
1720
with:
1821
ref: ${{ github.event.pull_request.head.sha }}
1922

2023
- name: Get Head Commit Message
2124
id: step-head-commit
2225
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
2326

24-
check-fmt:
25-
runs-on: ubuntu-latest
26-
needs: get-head-commit-msg
27-
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }}
28-
container:
29-
image: paritytech/ci-unified:bullseye-1.74.0
30-
steps:
31-
- uses: actions/checkout@v4
32-
3327
- name: Run cargo fmt
28+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-rust') }}
3429
run: cargo fmt -- --check
3530

3631
- name: Run taplo
32+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-rust') }}
3733
run: taplo fmt --check

.github/workflows/check-rustdoc.yml

+7-14
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,28 @@ on:
44
pull_request:
55

66
jobs:
7-
get-head-commit-msg:
7+
check-rustdoc:
88
runs-on: ubuntu-latest
99
outputs:
1010
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
1111
steps:
12-
- uses: actions/checkout@v4
12+
- name: Checkout
13+
uses: actions/checkout@v4
1314
with:
1415
ref: ${{ github.event.pull_request.head.sha }}
1516

1617
- name: Get Head Commit Message
1718
id: step-head-commit
1819
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
1920

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:
2521
- name: Free Disk Space
22+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-rust') }}
2623
uses: jlumbroso/free-disk-space@main
2724
with:
2825
tool-cache: true
2926

30-
- name: Checkout
31-
uses: actions/checkout@v4
32-
3327
- name: Set up Cargo Cache
28+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-rust') }}
3429
uses: actions/cache@v4
3530
with:
3631
path: |
@@ -42,10 +37,8 @@ jobs:
4237
restore-keys: |
4338
$ ${{ github.job }}-${{ github.ref_name }}-rustdoc-
4439
45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v3
47-
48-
- name: Run doc
40+
- name: Run cargo doc
41+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-rust') }}
4942
run: |
5043
docker run --rm \
5144
-v "${GITHUB_WORKSPACE}:/workspace" \

.github/workflows/docs-publish.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Chain docs
1+
name: Deploy rustdoc
22

33
on:
44
push:
@@ -18,10 +18,7 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020

21-
- name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v3
23-
24-
- name: Build and Deploy in Container
21+
- name: Run cargo doc
2522
run: |
2623
docker run --rm \
2724
-v "${GITHUB_WORKSPACE}:/workspace" \
+19-18
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
name: Integration tests
1+
name: Integration-tests
22

33
on:
44
pull_request:
5+
push:
6+
branches:
7+
- develop
8+
- master
9+
- 'refs/tags/[0-9]+.[0-9]+.[0-9]+*'
510

611
concurrency:
712
group: ${{ github.workflow }}-${{ github.ref_name }}
813
cancel-in-progress: true
914

1015
jobs:
11-
get-head-commit-msg:
12-
runs-on: ubuntu-latest
13-
outputs:
14-
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }}
15-
16-
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
ref: ${{ github.event.pull_request.head.sha }}
20-
21-
- name: Get Head Commit Message
22-
id: step-head-commit
23-
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
24-
2516
integration-tests:
2617
runs-on: ubuntu-latest
27-
needs: get-head-commit-msg
28-
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-integration-tests') }}
2918
env:
3019
working-dir: ./integration-tests/chopsticks
3120
CI: "true"
@@ -36,24 +25,36 @@ jobs:
3625
steps:
3726
- name: Checkout code
3827
uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.pull_request.head.sha }}
30+
31+
- name: Get Head Commit Message
32+
id: step-head-commit
33+
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
3934

4035
- name: Setup Node.js environment
36+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-integration-tests') }}
4137
uses: actions/setup-node@v4
4238
with:
4339
node-version-file: "${{ env.working-dir }}/.nvmrc"
4440

4541
- name: Install dependencies
42+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-integration-tests') }}
4643
run: yarn --immutable
4744

4845
- name: Type Checking
46+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-integration-tests') }}
4947
run: yarn ts-check
5048

5149
- name: Linting
50+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-integration-tests') }}
5251
run: yarn lint
53-
52+
5453
- name: Build Runtime
54+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-integration-tests') }}
5555
run: cargo build -p peregrine-runtime
5656

5757
- name: Test Suite
58+
if: ${{ !contains(steps.step-head-commit.outputs.headCommitMsg, 'ci-skip-integration-tests') }}
5859
run: yarn test:CI
5960

0 commit comments

Comments
 (0)