Skip to content

Commit

Permalink
[ci] Cleanup and order GHA workflows (#4449)
Browse files Browse the repository at this point in the history
Github currently [doesn't support creating
subfolders](https://github.com/orgs/community/discussions/18055) in
`.github/workflows` folder. PR unifies naming in this folder. The idea
is that all files ideally should have naming
`<stage>-<short_descriptive_name>.yml`. The stage names are taken from
gitlab and needed only for logical division.
Changes in actions:
 - `check-licences` runs on self-hosted runners
- `check-workspace` and `check-markdown` are moved to `checks-quick.yml`
 - `test-linux-stable-int` moved to a new file `tests-linux-stable.yml`
- `fmt-check.yml` file is removed, formatting is checked in
`checks-quick.yml`
  • Loading branch information
alvicsam authored May 14, 2024
1 parent 115c247 commit cedb1d4
Show file tree
Hide file tree
Showing 20 changed files with 126 additions and 106 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ permissions:

jobs:
check-licenses:
runs-on: ubuntu-latest
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
env:
LICENSES: "'Apache-2.0' 'GPL-3.0-only' 'GPL-3.0-or-later WITH Classpath-exception-2.0'"
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/check-markdown.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/check-runtime-migration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: check-runtime-migration

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/check-workspace.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
name: quick-checks

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
set-image:
# GitHub Actions allows using 'env' in a container context.
Expand Down Expand Up @@ -36,9 +41,9 @@ jobs:
check-dependency-rules:
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
# needs: [set-image]
# container:
# image: ${{ needs.set-image.outputs.IMAGE }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: check dependency rules
Expand Down Expand Up @@ -77,3 +82,40 @@ jobs:
run: |
taplo format --check --config .config/taplo.toml
echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues"
check-workspace:
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023)
- name: install python deps
run: |
sudo apt-get update && sudo apt-get install -y python3-pip python3
pip3 install toml
- name: check integrity
run: >
python3 .github/scripts/check-workspace.py .
--exclude
"substrate/frame/contracts/fixtures/build"
"substrate/frame/contracts/fixtures/contracts/common"
check-markdown:
runs-on: arc-runners-polkadot-sdk
timeout-minutes: 10
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Node.js
uses: actions/setup-node@v4.0.1
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
scope: "@paritytech"
- name: Install tooling
run: |
npm install -g markdownlint-cli
markdownlint --version
- name: Check Markdown
env:
CONFIG: .github/.markdownlint.yaml
run: |
echo "Checking markdown formatting. More info: docs/contributor/markdown_linting.md"
markdownlint --config "$CONFIG" --ignore target .
23 changes: 0 additions & 23 deletions .github/workflows/fmt-check.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Actions that makes review-bot green in the merge queue
name: Merge-Queue

on:
Expand All @@ -18,7 +19,7 @@ jobs:
uses: billyjbryant/create-status-check@3e6fa0ac599d10d9588cf9516ca4330ef669b858 # v2
with:
authToken: ${{ steps.app_token.outputs.token }}
context: 'review-bot'
description: 'PRs for merge queue gets approved'
state: 'success'
context: "review-bot"
description: "PRs for merge queue gets approved"
state: "success"
sha: ${{ github.event.merge_group.head_commit.id }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions .github/workflows/tests-linux-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# GHA for test-linux-stable-int, test-linux-stable, test-linux-stable-oldkernel
name: tests linux stable

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }}
FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }}
FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }}
FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }}
FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }}

jobs:
set-image:
# GitHub Actions allows using 'env' in a container context.
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
# This workaround sets the container image for each job using 'set-image' job output.
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
test-linux-stable-int:
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: 1
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: WASM_BUILD_NO_COLOR=1 time forklift cargo test -p staging-node-cli --release --locked -- --ignored
# https://github.com/paritytech/ci_cd/issues/864
test-linux-stable-runtime-benchmarks:
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: time forklift cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet
21 changes: 3 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: tests

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
Expand Down Expand Up @@ -28,24 +31,6 @@ jobs:
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
test-linux-stable-int:
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.IMAGE }}
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
RUST_BACKTRACE: 1
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: script
run: WASM_BUILD_NO_COLOR=1 time forklift cargo test -p staging-node-cli --release --locked -- --ignored
quick-benchmarks:
runs-on: arc-runners-polkadot-sdk-beefy
timeout-minutes: 30
Expand Down
2 changes: 0 additions & 2 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ test-linux-stable:
script:
# Build all but only execute 'runtime' tests.
- echo "Node index - ${CI_NODE_INDEX}. Total amount - ${CI_NODE_TOTAL}"
# add experimental to features after https://github.com/paritytech/substrate/pull/14502 is merged
# "upgrade_version_checks_should_work" is currently failing
- >
time cargo nextest run \
--workspace \
Expand Down

0 comments on commit cedb1d4

Please sign in to comment.