Skip to content

Commit

Permalink
Merge branch 'master' into jv-bump-zombienet
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored Oct 16, 2024
2 parents f54356a + 504edb1 commit ec380e9
Show file tree
Hide file tree
Showing 136 changed files with 13,662 additions and 2,178 deletions.
1 change: 0 additions & 1 deletion .github/workflows/check-cargo-check-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ jobs:
- check-runtime-coretime
- check-runtime-bridge-hubs
- check-runtime-contracts
- check-runtime-starters
- check-runtime-testing
if: always() && !cancelled()
steps:
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/check-features.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
check-labels:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check labels
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ permissions:
jobs:
link-checker:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Restore lychee cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v3.3.2 (7. Sep 2023)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
jobs:
check-prdoc:
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event.pull_request.number != ''
steps:
- name: Checkout repo
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
uses: ./.github/workflows/reusable-preflight.yml
check-semver:
runs-on: ubuntu-latest
timeout-minutes: 90
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/command-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# This trigger can be problematic, see: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
# In our case it is fine since we only run it on merged Pull Requests and do not execute any of the repo code itself.
pull_request_target:
types: [ closed, labeled ]
types: [closed, labeled]

permissions:
contents: write # so it can comment
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
with:
script: |
const pullNumbers = '${{ steps.backport.outputs.created_pull_numbers }}'.split(' ');
for (const pullNumber of pullNumbers) {
await github.rest.issues.addLabels({
issue_number: parseInt(pullNumber),
Expand All @@ -84,7 +84,7 @@ jobs:
script: |
const pullNumbers = '${{ steps.backport.outputs.created_pull_numbers }}'.split(' ');
const reviewer = '${{ github.event.pull_request.user.login }}';
for (const pullNumber of pullNumbers) {
await github.pulls.createReviewRequest({
owner: context.repo.owner,
Expand Down
70 changes: 47 additions & 23 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,11 @@ concurrency:

jobs:
preflight:
if: contains(github.event.label.name, 'GHA-migration')
uses: ./.github/workflows/reusable-preflight.yml

test-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@v4
- run: forklift cargo doc --workspace --all-features --no-deps
env:
SKIP_WASM_BUILD: 1
test-doc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand All @@ -41,8 +30,9 @@ jobs:

build-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 40
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight, test-rustdoc]
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
Expand Down Expand Up @@ -88,6 +78,23 @@ jobs:
retention-days: 1
if-no-files-found: error

confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All docs jobs passed
# If any new job gets added, be sure to add it to this array
needs: [test-doc, build-rustdoc, build-implementers-guide]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
publish-rustdoc:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -121,13 +128,30 @@ jobs:
- run: mkdir -p book
- name: Move book files
run: mv /tmp/book/html/* book/
- name: Push to GH-Pages branch
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ steps.app-token.outputs.token }}
push-branch: "gh-pages"
commit-message: "___Updated docs for ${{ github.head_ref || github.ref_name }}___"
force-add: "true"
files: ${{ github.head_ref || github.ref_name }}/ book/
name: devops-parity
email: devops-team@parity.io
- name: Push changes to gh-pages
env:
TOKEN: ${{ steps.app-token.outputs.token }}
APP_NAME: "paritytech-upd-ghpages-polkadotsdk"
REF_NAME: ${{ github.head_ref || github.ref_name }}
Green: "\e[32m"
NC: "\e[0m"
run: |
echo "${Green}Git add${NC}"
git add book/
git add ${REF_NAME}/
echo "${Green}git status | wc -l${NC}"
git status | wc -l
echo "${Green}Add new remote with gh app token${NC}"
git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
echo "${Green}Remove http section that causes issues with gh app auth token${NC}"
sed -i.bak '/\[http/d' ./.git/config
sed -i.bak '/extraheader/d' ./.git/config
echo "${Green}Git push${NC}"
git config user.email "ci@parity.io"
git config user.name "${APP_NAME}"
git commit --amend -m "___Updated docs" || echo "___Nothing to commit___"
git push origin gh-pages --force
16 changes: 8 additions & 8 deletions .github/workflows/fork-sync-action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This Workflow is not supposed to run in the paritytech/polkadot-sdk repo.
# This Workflow is supposed to run only in the forks of the repo,
# This Workflow is supposed to run only in the forks of the repo,
# paritytech-release/polkadot-sdk specifically,
# to automatically maintain the critical fork synced with the upstream.
# This Workflow should be always disabled in the paritytech/polkadot-sdk repo.
Expand All @@ -11,10 +11,10 @@ on:
workflow_dispatch:

jobs:
job_sync_branches:
uses: paritytech-release/sync-workflows/.github/workflows/sync-with-upstream.yml@latest
with:
fork_writer_app_id: ${{ vars.UPSTREAM_CONTENT_SYNC_APP_ID}}
fork_owner: ${{ vars.RELEASE_ORG}}
secrets:
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
job_sync_branches:
uses: paritytech-release/sync-workflows/.github/workflows/sync-with-upstream.yml@latest
with:
fork_writer_app_id: ${{ vars.UPSTREAM_CONTENT_SYNC_APP_ID}}
fork_owner: ${{ vars.RELEASE_ORG}}
secrets:
fork_writer_app_key: ${{ secrets.UPSTREAM_CONTENT_SYNC_APP_KEY }}
7 changes: 6 additions & 1 deletion .github/workflows/tests-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ jobs:
- name: script
id: compare
run: |
if [ "${{ github.ref_name }}" = "master" ]; then
echo -e "Exiting on master branch"
exit 0
fi
docker run --rm \
-v $PWD/artifacts/master:/artifacts/master \
-v $PWD/artifacts/current:/artifacts/current \
Expand Down Expand Up @@ -299,7 +304,7 @@ jobs:
# name: hfuzz-${{ github.sha }}

cargo-check-each-crate:
timeout-minutes: 140
timeout-minutes: 70
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
Expand Down
43 changes: 0 additions & 43 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,49 +100,6 @@ build-templates-node:
- mv ./target/release/minimal-template-node ./artifacts/.
- mv ./target/release/solochain-template-node ./artifacts/.

build-rustdoc:
stage: build
extends:
- .docker-env
- .common-refs
- .run-immediately
variables:
SKIP_WASM_BUILD: 1
RUSTDOCFLAGS: "-Dwarnings --default-theme=ayu --html-in-header ./docs/sdk/assets/header.html --extend-css ./docs/sdk/assets/theme.css --html-after-content ./docs/sdk/assets/after-content.html"
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
expire_in: 1 days
paths:
- ./crate-docs/
script:
- time cargo doc --all-features --workspace --no-deps
- rm -f ./target/doc/.lock
- mv ./target/doc ./crate-docs
# Inject Simple Analytics (https://www.simpleanalytics.com/) privacy preserving tracker into
# all .html files
- >
inject_simple_analytics() {
local path="$1";
local script_content="<script async defer src=\"https://apisa.parity.io/latest.js\"></script><noscript><img src=\"https://apisa.parity.io/latest.js\" alt=\"\" referrerpolicy=\"no-referrer-when-downgrade\" /></noscript>";
# Function that inject script into the head of an html file using sed.
process_file() {
local file="$1";
echo "Adding Simple Analytics script to $file";
sed -i "s|</head>|$script_content</head>|" "$file";
};
export -f process_file;
# xargs runs process_file in separate shells without access to outer variables.
# make script_content available inside process_file, export it as an env var here.
export script_content;
# Modify .html files in parallel using xargs, otherwise it can take a long time.
find "$path" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'process_file "$@"' _ {};
};
inject_simple_analytics "./crate-docs";
- echo "<meta http-equiv=refresh content=0;url=polkadot_sdk_docs/index.html>" > ./crate-docs/index.html

build-implementers-guide:
stage: build
extends:
Expand Down
61 changes: 0 additions & 61 deletions .gitlab/pipeline/publish.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,6 @@
# This file is part of .gitlab-ci.yml
# Here are all jobs that are executed during "publish" stage

publish-rustdoc:
stage: publish
extends:
- .kubernetes-env
- .publish-gh-pages-refs
variables:
CI_IMAGE: node:18
GIT_DEPTH: 100
RUSTDOCS_DEPLOY_REFS: "master"
needs:
- job: build-rustdoc
artifacts: true
- job: build-implementers-guide
artifacts: true
script:
# If $CI_COMMIT_REF_NAME doesn't match one of $RUSTDOCS_DEPLOY_REFS space-separated values, we
# exit immediately.
# Putting spaces at the front and back to ensure we are not matching just any substring, but the
# whole space-separated value.
# setup ssh
- eval $(ssh-agent)
- ssh-add - <<< ${GITHUB_SSH_PRIV_KEY}
- mkdir ~/.ssh && touch ~/.ssh/known_hosts
- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# Set git config
- git config user.email "devops-team@parity.io"
- git config user.name "${GITHUB_USER}"
- git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages
# Save README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp -r ./artifacts/book/ /tmp/
- cp README.md /tmp/doc/
# we don't need to commit changes because we copy docs to /tmp
- git checkout gh-pages --force
# Enable if docs needed for other refs
# Install `index-tpl-crud` and generate index.html based on RUSTDOCS_DEPLOY_REFS
# - which index-tpl-crud &> /dev/null || yarn global add @substrate/index-tpl-crud
# - index-tpl-crud upsert ./index.html ${CI_COMMIT_REF_NAME}
# Ensure the destination dir doesn't exist.
- rm -rf ${CI_COMMIT_REF_NAME}
- rm -rf book/
- mv -f /tmp/doc ${CI_COMMIT_REF_NAME}
# dir for implementors guide
- mkdir -p book
- mv /tmp/book/html/* book/
# Upload files
- git add --all
# `git commit` has an exit code of > 0 if there is nothing to commit.
# This causes GitLab to exit immediately and marks this job failed.
# We don't want to mark the entire job failed if there's nothing to
# publish though, hence the `|| true`.
- git commit --amend -m "___Updated docs" ||
echo "___Nothing to commit___"
- git push origin gh-pages --force
# artificial sleep to publish gh-pages
- sleep 300
after_script:
- rm -rf .git/ ./*

# note: images are used not only in zombienet but also in rococo, wococo and versi
.build-push-image:
image: $BUILDAH_IMAGE
Expand Down
27 changes: 0 additions & 27 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,3 @@ test-linux-stable-codecov:
else
codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github;
fi
test-doc:
stage: test
extends:
- .docker-env
- .common-refs
# DAG
needs:
- job: test-rustdoc
artifacts: false
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo test --doc --workspace

test-rustdoc:
stage: test
extends:
- .docker-env
- .common-refs
- .run-immediately
variables:
SKIP_WASM_BUILD: 1
script:
- time cargo doc --workspace --all-features --no-deps
Loading

0 comments on commit ec380e9

Please sign in to comment.