Skip to content

Commit 194c3c2

Browse files
Merge pull request #14 from paritytech/common-base
Bring main branch up to date
2 parents 6f05ffa + eeaeb94 commit 194c3c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+15115
-6607
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/check.yml

Lines changed: 62 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check Set-Up & Build
1+
name: CI
22

33
# Controls when the action will run.
44
on:
@@ -11,33 +11,74 @@ on:
1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
1313

14-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
# Cancel previous runs
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
# Parity CI image to use
20+
# Common variable is defined in the workflow
21+
# Repo env variable doesn't work for PRs from forks
22+
env:
23+
CI_IMAGE: "paritytech/ci-unified:bullseye-1.84.1-2025-01-28-v202502131220"
24+
1525
jobs:
16-
check:
17-
# The type of runner that the job will run on
18-
runs-on: ubuntu-22.04
26+
set-image:
27+
# This workaround sets the container image for each job using 'set-image' job output.
28+
# env variables don't work for PRs from forks, so we need to use outputs.
29+
runs-on: ubuntu-latest
30+
outputs:
31+
CI_IMAGE: ${{ steps.set_image.outputs.CI_IMAGE }}
32+
steps:
33+
- id: set_image
34+
run: echo "CI_IMAGE=${{ env.CI_IMAGE }}" >> $GITHUB_OUTPUT
1935

20-
# Steps represent a sequence of tasks that will be executed as part of the job
36+
check:
37+
name: Cargo check
38+
runs-on: ubuntu-latest
39+
needs: [set-image]
40+
container:
41+
image: ${{ needs.set-image.outputs.CI_IMAGE }}
2142
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23-
- uses: actions/checkout@v3
43+
- name: Checkout sources
44+
uses: actions/checkout@v4
2445

25-
- name: Install linux dependencies
26-
run: sudo apt-get install -y clang libssl-dev llvm libudev-dev protobuf-compiler
27-
28-
- name: Install Rust
29-
run: |
30-
rustup update stable --no-self-update
31-
rustup target add wasm32-unknown-unknown
46+
- name: Install Rust stable toolchain
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
profile: minimal
50+
toolchain: stable
51+
override: true
3252

3353
# Rust cache
34-
- uses: Swatinem/rust-cache@v2
54+
- name: Rust cache
55+
uses: Swatinem/rust-cache@v2
56+
with:
57+
cache-on-failure: true
58+
cache-all-crates: true
3559

36-
- name: Check Build
60+
- name: Cargo check
3761
run: |
38-
SKIP_WASM_BUILD=1 cargo check --release
62+
SKIP_WASM_BUILD=1 cargo check
63+
64+
check-benchmarking:
65+
name: Cargo check (benchmarking)
66+
runs-on: ubuntu-latest
67+
needs: [set-image]
68+
container:
69+
image: ${{ needs.set-image.outputs.CI_IMAGE }}
70+
steps:
71+
- name: Checkout sources
72+
uses: actions/checkout@v4
73+
74+
# Rust cache
75+
- name: Rust cache
76+
uses: Swatinem/rust-cache@v2
77+
with:
78+
cache-on-failure: true
79+
cache-all-crates: true
3980

40-
- name: Check Build for Benchmarking
81+
- name: Cargo check (benchmarking)
4182
run: >
42-
pushd node &&
43-
cargo check --features=runtime-benchmarks --release
83+
cd node &&
84+
cargo check --features=runtime-benchmarks

BRIDGES.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Using Parity Bridges Common dependency (`git subtree`).
2+
3+
In `./bridges` sub-directory you can find a `git subtree` imported version of:
4+
[parity-bridges-common](https://github.com/paritytech/parity-bridges-common/) repository.
5+
6+
# How to pull latest Bridges code to the `bridges` subtree
7+
(in practice)
8+
9+
The `bridges` repo has a stabilized branch `polkadot-v.1.0.0-audited` dedicated for releasing
10+
and based on Polkadot v1.0.0 code.
11+
12+
```
13+
cd <polkadot-bulletin-chain-git-repo-dir>
14+
15+
# needs to be done only once
16+
git remote add -f bridges https://github.com/paritytech/parity-bridges-common.git
17+
18+
# this will update new git branches from bridges repo
19+
# there could be unresolved conflicts, but dont worry,
20+
# lots of them are caused because of removed unneeded files with patch step,
21+
git fetch bridges --prune
22+
git subtree pull --prefix=bridges bridges polkadot-v.1.0.0-audited --squash
23+
24+
# if the command above fails with the "Can't squash-merge: 'bridges' was never added" or
25+
# "fatal: refusing to merge unrelated histories" error, use this:
26+
# git merge -s subtree -Xsubtree="bridges" bridges/polkadot-v.1.0.0-audited --allow-unrelated-histories --squash
27+
28+
# so, after fetch and before solving conflicts just run patch,
29+
# this will remove unneeded files and checks if subtree modules compiles
30+
#
31+
# if it fails to build, you'll need to resolve conflicts manually
32+
./bridges/scripts/verify-pallets-build.sh --ignore-git-state --no-revert
33+
34+
# if there are conflicts, this could help,
35+
# this removes locally deleted files at least (move changes to git stash for commit)
36+
git status -s | awk '$1 == "DU" || $1 == "D" || $1 == "MD" || $1 == "AD" {print $2}' | grep "^bridges/" | xargs git rm -q --ignore-unmatch
37+
38+
# (optional) when conflicts resolved, you can check build again - should pass
39+
# also important: this updates global Cargo.lock
40+
git commit --amend -S -m "updating bridges subtree + remove extra folders"
41+
42+
# add changes to the commit, first command `fetch` starts merge,
43+
# so after all conflicts are solved and patch passes and compiles,
44+
# then we need to finish merge with:
45+
git merge --continue
46+
````

0 commit comments

Comments
 (0)