Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ggera committed Aug 7, 2024
1 parent 8419714 commit b2917a8
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 45 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/check-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@ name: Check fmt

on:
pull_request:
types: [opened, synchronize, reopened, edited]
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check_skip_flags:
get_head_commit_msg:
runs-on: ubuntu-latest
outputs:
head_commit_message: ${{ steps.step_head_commit.outputs.headCommitMsg }}
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_SHA }}
- name: Get Head Commit Message
id: head-commit-message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
id: step_head_commit
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

check-fmt:
runs-on: ubuntu-latest
needs: check_skip_flags
needs: get_head_commit_msg
container:
image: paritytech/ci-unified:bullseye-1.74.0
if: ${{ !contains(needs.check_skip_flags.outputs.head-commit-message, 'ci-skip-rust') }}
if: ${{ !contains(needs.get_head_commit_msg.outputs.head_commit_message, 'ci-skip-rust') }}
steps:
- uses: actions/checkout@v4
- name: Run cargo fmt
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,28 @@ concurrency:
cancel-in-progress: true

jobs:
check_skip_flags:
get_head_commit_msg:
runs-on: ubuntu-latest
outputs:
head_commit_message: ${{ steps.step_head_commit.outputs.headCommitMsg }}
env:
working-directory: ./integration-tests/chopsticks
defaults:
run:
working-directory: ${{ env.working-directory }}

steps:
- name: Checkout Commit
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_SHA }}
- name: Get Head Commit Message
id: head-commit-message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
id: step_head_commit
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

integration-tests:
runs-on: ubuntu-latest
needs: check_skip_flags
if: ${{ !contains(needs.check_skip_flags.outputs.head-commit-message, 'ci-skip-integration-tests') }}
needs: get_head_commit_msg
if: ${{ !contains(needs.get_head_commit_msg.outputs.head_commit_message, 'ci-skip-integration-tests') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -37,12 +44,10 @@ jobs:
nvm install
nvm use
yarn --immutable
working-directory: ./integration-tests/chopsticks
- name: Lint & Test
run: |
yarn ts-check
yarn lint
yarn test:CI
working-directory: ./integration-tests/chopsticks
12 changes: 8 additions & 4 deletions .github/workflows/srtool-build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Srtool build

on:
release:
types: [published]
push:
branches:
- develop
- master
- ci-cache
- 'refs/tags/[0-9]+.[0-9]+.[0-9]+*'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
SUBWASM_VERSION: v0.20.0
SUBWASM_VERSION: 0.21.3

jobs:
build-wasm:
Expand Down Expand Up @@ -67,7 +71,7 @@ jobs:
subwasm get -o ${{ matrix.runtime }}-live.wasm wss://${{ matrix.runtime }}.kilt.io
subwasm diff --no-color ${{ matrix.runtime }}-live.wasm ${{ steps.srtool_build.outputs.wasm }} || \
echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.runtime }} is not known by subwasm" | \
tee ${{ matrix.chain }}-diff.txt
tee ${{ matrix.runtime }}-diff.txt
- name: Archive Subwasm results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/try-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Try-runtime

on:
pull_request:
types: [opened, synchronize, reopened, edited]
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -11,29 +11,31 @@ concurrency:
env:
TRY_RUNTIME_CLI_VERSION_TAG: v0.7.0
CARGO_HOME: ./.cargo
SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings"

jobs:
check_skip_flags:
get_head_commit_msg:
runs-on: ubuntu-latest
outputs:
head_commit_message: ${{ steps.step_head_commit.outputs.headCommitMsg }}
steps:
- name: Checkout Commit
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_SHA }}
- name: Get Head Commit Message
id: head-commit-message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"
id: step_head_commit
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"


test-try-runtime:
strategy:
matrix:
runtime: [peregrine, spiritnet]
runs-on: ubuntu-latest
needs: check_skip_flags
needs: get_head_commit_msg
container:
image: paritytech/ci-unified:bullseye-1.74.0

if: ${{ !contains(needs.check_skip_flags.outputs.head-commit-message, 'ci-skip-rust') }}
if: ${{ !contains(needs.get_head_commit_msg.outputs.head_commit_message, 'ci-skip-rust') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -61,4 +63,4 @@ jobs:
echo "---------- Executing on-runtime-upgrade for ${{ matrix.runtime }} ----------"
./try-runtime --runtime ./target/release/wbuild/${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.compressed.wasm \
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} live --uri wss://${{ matrix.runtime }}.kilt.io
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ env.SUBCOMMAND_EXTRA_ARGS }} live --uri wss://${{ matrix.runtime }}.kilt.io
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default:
include:
- local: '.gitlab/check.yml'
- local: '.gitlab/test.yml'
- local: '.gitlab/build.yml'
- local: '.gitlab/build_docker_img.yml'

variables:
CARGO_CACHE_PATH: $CARGO_CACHE_PATH
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions .gitlab/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ cargo-clippy-all-features:
- ${CARGO_CACHE_PATH}
script:
- SKIP_WASM_BUILD=1 cargo clippy --all-targets --all-features --locked --quiet

check-rustdoc:
extends: .check_skip_rust
image: paritytech/ci-unified:bullseye-1.74.0
variables:
SKIP_WASM_BUILD: 1
stage: check
cache:
key: cargo-check-rustdoc
paths:
- ${CARGO_CACHE_PATH}
script:
- cargo doc --all-features --no-deps --locked
13 changes: 0 additions & 13 deletions .gitlab/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ test:
script:
- cargo test --all-targets --locked

test-rustdoc:
extends: .check_skip_rust
image: paritytech/ci-unified:bullseye-1.74.0
variables:
SKIP_WASM_BUILD: 1
stage: check
cache:
key: cargo-test-rustdoc
paths:
- ${CARGO_CACHE_PATH}
script:
- cargo doc --all-features --no-deps --locked

test-features:
extends: .check_skip_rust
timeout: 2 hours
Expand Down

0 comments on commit b2917a8

Please sign in to comment.