Skip to content

Commit fcb60bc

Browse files
authored
Add workflow running exported actions for polkadot-sdk compatibility (#293)
* Add workflow for polkadot-sdk compatibility. * Remove redundant 'shell'. * Restore 'shell'. * Use sha from previous job. * Temporarily test if concurrency bump would fix polkadot-sdk CI. * Remove temporary concurrency setting.
1 parent 33c3bab commit fcb60bc

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Exercises the relevant GH action the same way polkadot-sdk does, but against
2+
# this repo's current working tree and polkadot-sdk's master branch, to catch
3+
# breaking changes before polkadot-sdk bumps the revive-differential-tests commit it pins.
4+
name: Polkadot SDK Compatibility
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths-ignore:
11+
- "**/*.md"
12+
pull_request:
13+
branches:
14+
- main
15+
paths-ignore:
16+
- "**/*.md"
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
resolve-config:
25+
runs-on: ubuntu-24.04
26+
outputs:
27+
image: ${{ steps.config.outputs.image }}
28+
resolc-version: ${{ steps.config.outputs.resolc-version }}
29+
polkadot-sdk-sha: ${{ steps.config.outputs.polkadot-sdk-sha }}
30+
steps:
31+
- name: Checkout the Polkadot SDK CI environment
32+
uses: actions/checkout@v6
33+
with:
34+
repository: paritytech/polkadot-sdk
35+
ref: master
36+
sparse-checkout: .github
37+
38+
- name: Resolve Polkadot SDK configuration
39+
id: config
40+
shell: bash
41+
run: |
42+
set -euo pipefail
43+
source .github/env
44+
echo "image=$IMAGE" >> "$GITHUB_OUTPUT"
45+
echo "resolc-version=$RESOLC_VERSION" >> "$GITHUB_OUTPUT"
46+
echo "polkadot-sdk-sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
47+
48+
differential-tests:
49+
needs: resolve-config
50+
runs-on: parity-large-persistent
51+
timeout-minutes: 60
52+
container:
53+
image: ${{ needs.resolve-config.outputs.image }}
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
platform:
58+
- revive-dev-node-revm-solc
59+
- revive-dev-node-polkavm-resolc
60+
steps:
61+
- name: Checkout revive-differential-tests
62+
uses: actions/checkout@v6
63+
with:
64+
path: revive-differential-tests
65+
submodules: recursive
66+
67+
- name: Checkout the Polkadot SDK
68+
uses: actions/checkout@v6
69+
with:
70+
repository: paritytech/polkadot-sdk
71+
ref: ${{ needs.resolve-config.outputs.polkadot-sdk-sha }}
72+
path: polkadot-sdk
73+
74+
- name: Configure forklift
75+
shell: bash
76+
run: |
77+
mkdir -p .forklift
78+
cp polkadot-sdk/.forklift/config.toml .forklift/config.toml
79+
80+
- name: Download resolc
81+
id: resolc
82+
shell: bash
83+
env:
84+
RESOLC_VERSION: ${{ needs.resolve-config.outputs.resolc-version }}
85+
run: |
86+
set -euo pipefail
87+
INSTALL_DIR="/usr/local/bin"
88+
curl -fsSL --retry 3 -o "$INSTALL_DIR/resolc" "https://github.com/paritytech/revive/releases/download/v${RESOLC_VERSION}/resolc-x86_64-unknown-linux-musl"
89+
chmod +x "$INSTALL_DIR/resolc"
90+
resolc --version
91+
echo "resolc-path=$INSTALL_DIR/resolc" >> "$GITHUB_OUTPUT"
92+
93+
- name: Run the differential tests
94+
uses: ./revive-differential-tests/.github/actions/run-differential-tests
95+
with:
96+
platform: ${{ matrix.platform }}
97+
revive-differential-tests-path: revive-differential-tests
98+
polkadot-sdk-path: polkadot-sdk
99+
cargo-command: "forklift cargo"
100+
resolc-path: ${{ steps.resolc.outputs.resolc-path }}
101+
expectations-file-path: polkadot-sdk/.github/assets/${{ matrix.platform }}.json

0 commit comments

Comments
 (0)