Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Move scripts used in CI to the new location (#11008)
Browse files Browse the repository at this point in the history
Move scripts used in CI to the new location - **./scripts/ci/**

* Move github scripts

* Move more files

* Move ci scripts and fix dependencies

* Update docs/node-template-release.md

Co-authored-by: João Paulo Silva de Souza <[email protected]>

* Remove Cargo.lock

* Apply suggestions from code review

Co-authored-by: Denis Pisarev <[email protected]>

* Make more paths uniform

Co-authored-by: João Paulo Silva de Souza <[email protected]>
Co-authored-by: Denis Pisarev <[email protected]>
  • Loading branch information
3 people authored Mar 14, 2022
1 parent 89fcb3e commit b797b89
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Check labels
run: bash ${{ github.workspace }}/.maintain/github/check_labels.sh
run: bash ${{ github.workspace }}/scripts/ci/github/check_labels.sh
env:
GITHUB_PR: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/monthly-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
echo "" >> Changelog.md
echo "## Changes since last snapshot (${{ steps.tags.outputs.old }})" >> Changelog.md
echo "" >> Changelog.md
./.maintain/gitlab/generate_changelog.sh ${{ steps.tags.outputs.old }} >> Changelog.md
./scripts/ci/github/generate_changelog.sh ${{ steps.tags.outputs.old }} >> Changelog.md
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ rls*.log
.cargo-remote.toml
*.bin
*.iml
.maintain/node-template-release/Cargo.lock
scripts/ci/node-template-release/Cargo.lock
52 changes: 26 additions & 26 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# script:
# - echo "List of shell commands to run in your job"
# - echo "You can also just specify a script here, like so:"
# - ./.maintain/gitlab/my_amazing_script.sh
# - ./scripts/ci/gitlab/my_amazing_script.sh

stages:
- check
Expand Down Expand Up @@ -165,12 +165,12 @@ default:
fi

.cargo-check-benches-script: &cargo-check-benches-script
- mkdir -p artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
- mkdir -p ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
- SKIP_WASM_BUILD=1 time cargo +nightly check --benches --all
- 'cargo run --release -p node-bench -- ::node::import::native::sr25519::transfer_keep_alive::paritydb::small --json
| tee artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA/::node::import::native::sr25519::transfer_keep_alive::paritydb::small.json'
| tee ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA/::node::import::native::sr25519::transfer_keep_alive::paritydb::small.json'
- 'cargo run --release -p node-bench -- ::trie::read::small --json
| tee artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA/::trie::read::small.json'
| tee ./artifacts/benches/$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA/::trie::read::small.json'
- sccache -s

.build-linux-substrate-script: &build-linux-substrate-script
Expand All @@ -185,7 +185,7 @@ default:
tee ./artifacts/substrate/VERSION;
fi
- sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256
- cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/
- cp -r ./scripts/ci/docker/substrate.Dockerfile ./artifacts/substrate/
- sccache -s

#### Vault secrets
Expand Down Expand Up @@ -241,7 +241,7 @@ skip-if-draft:
- echo "Commit message is ${CI_COMMIT_MESSAGE}"
- echo "Ref is ${CI_COMMIT_REF_NAME}"
- echo "pipeline source is ${CI_PIPELINE_SOURCE}"
- ./.maintain/gitlab/skip_if_draft.sh
- ./scripts/ci/gitlab/skip_if_draft.sh

#### stage: check

Expand All @@ -256,7 +256,7 @@ check-runtime:
GITLAB_API: "https://gitlab.parity.io/api/v4"
GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api"
script:
- ./.maintain/gitlab/check_runtime.sh
- ./scripts/ci/gitlab/check_runtime.sh
allow_failure: true

check-signed-tag:
Expand All @@ -267,7 +267,7 @@ check-signed-tag:
- if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
script:
- ./.maintain/gitlab/check_signed.sh
- ./scripts/ci/gitlab/check_signed.sh

test-dependency-rules:
stage: check
Expand All @@ -276,7 +276,7 @@ test-dependency-rules:
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
- .maintain/ensure-deps.sh
- ./scripts/ci/gitlab/ensure-deps.sh

test-prometheus-alerting-rules:
stage: check
Expand All @@ -288,11 +288,11 @@ test-prometheus-alerting-rules:
- if: $CI_COMMIT_BRANCH
changes:
- .gitlab-ci.yml
- .maintain/monitoring/**/*
- ./scripts/ci/monitoring/**/*
script:
- promtool check rules .maintain/monitoring/alerting-rules/alerting-rules.yaml
- cat .maintain/monitoring/alerting-rules/alerting-rules.yaml |
promtool test rules .maintain/monitoring/alerting-rules/alerting-rule-tests.yaml
- promtool check rules ./scripts/ci/monitoring/alerting-rules/alerting-rules.yaml
- cat ./scripts/ci/monitoring/alerting-rules/alerting-rules.yaml |
promtool test rules ./scripts/ci/monitoring/alerting-rules/alerting-rule-tests.yaml

#### stage: test

Expand All @@ -301,10 +301,10 @@ cargo-deny:
<<: *docker-env
<<: *nightly-pipeline
script:
- cargo deny check --hide-inclusion-graph -c .maintain/deny.toml
- cargo deny check --hide-inclusion-graph -c ./scripts/ci/deny.toml
after_script:
- echo "___The complete log is in the artifacts___"
- cargo deny check -c .maintain/deny.toml 2> deny.log
- cargo deny check -c ./scripts/ci/deny.toml 2> deny.log
artifacts:
name: $CI_COMMIT_SHORT_SHA
expire_in: 3 days
Expand Down Expand Up @@ -404,13 +404,13 @@ test-deterministic-wasm:
# build runtime
- cargo build --verbose --release -p node-runtime
# make checksum
- sha256sum target/release/wbuild/node-runtime/target/wasm32-unknown-unknown/release/node_runtime.wasm > checksum.sha256
- sha256sum ./target/release/wbuild/node-runtime/target/wasm32-unknown-unknown/release/node_runtime.wasm > checksum.sha256
# clean up – FIXME: can we reuse some of the artifacts?
- cargo clean
# build again
- cargo build --verbose --release -p node-runtime
# confirm checksum
- sha256sum -c checksum.sha256
- sha256sum -c ./checksum.sha256
- sccache -s

test-linux-stable: &test-linux
Expand All @@ -426,8 +426,8 @@ test-linux-stable: &test-linux
WASM_BUILD_NO_COLOR: 1
script:
# this job runs all tests in former runtime-benchmarks, frame-staking and wasmtime tests
- time cargo test --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml
- time cargo test -p frame-support-test --features=conditional-storage,no-metadata-docs --manifest-path frame/support/test/Cargo.toml --test pallet # does not reuse cache 1 min 44 sec
- time cargo test --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path ./bin/node/cli/Cargo.toml
- time cargo test -p frame-support-test --features=conditional-storage,no-metadata-docs --manifest-path ./frame/support/test/Cargo.toml --test pallet # does not reuse cache 1 min 44 sec
- SUBSTRATE_TEST_TIMEOUT=1 time cargo test -p substrate-test-utils --release --verbose --locked -- --ignored timeout
- sccache -s

Expand All @@ -443,7 +443,7 @@ test-frame-examples-compile-to-wasm:
RUSTFLAGS: "-Cdebug-assertions=y"
RUST_BACKTRACE: 1
script:
- cd frame/examples/offchain-worker/
- cd ./frame/examples/offchain-worker/
- cargo +nightly build --target=wasm32-unknown-unknown --no-default-features
- cd ../basic
- cargo +nightly build --target=wasm32-unknown-unknown --no-default-features
Expand Down Expand Up @@ -475,8 +475,8 @@ check-tracing:
<<: *test-refs
script:
# with-tracing must be explicitly activated, we run a test to ensure this works as expected in both cases
- time cargo +nightly test --manifest-path primitives/tracing/Cargo.toml --no-default-features
- time cargo +nightly test --manifest-path primitives/tracing/Cargo.toml --no-default-features --features=with-tracing
- time cargo +nightly test --manifest-path ./primitives/tracing/Cargo.toml --no-default-features
- time cargo +nightly test --manifest-path ./primitives/tracing/Cargo.toml --no-default-features --features=with-tracing
- sccache -s

test-full-crypto-feature:
Expand Down Expand Up @@ -568,7 +568,7 @@ build-linux-substrate:
script:
- *build-linux-substrate-script
- printf '\n# building node-template\n\n'
- ./.maintain/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz
- ./scripts/ci/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz

build-linux-subkey: &build-subkey
stage: build
Expand All @@ -590,7 +590,7 @@ build-linux-subkey: &build-subkey
sed -n -E 's/^subkey ([0-9.]+.*)/\1/p' |
tee ./artifacts/subkey/VERSION;
- sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256
- cp -r .maintain/docker/subkey.Dockerfile ./artifacts/subkey/
- cp -r ./scripts/ci/docker/subkey.Dockerfile ./artifacts/subkey/
- sccache -s

build-macos-subkey:
Expand Down Expand Up @@ -784,7 +784,7 @@ publish-draft-release:
- if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
script:
- ./.maintain/gitlab/publish_draft_release.sh
- ./scripts/ci/gitlab/publish_draft_release.sh
allow_failure: true

#### stage: deploy
Expand All @@ -807,4 +807,4 @@ deploy-prometheus-alerting-rules:
- if: $CI_COMMIT_REF_NAME == "master"
changes:
- .gitlab-ci.yml
- .maintain/monitoring/**/*
- ./scripts/ci/monitoring/**/*
2 changes: 1 addition & 1 deletion docs/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# - The latest matching rule, if multiple, takes precedence.

# CI
/.maintain/ @paritytech/ci
/scripts/ci/ @paritytech/ci
/.github/ @paritytech/ci
/.gitlab-ci.yml @paritytech/ci

Expand Down
4 changes: 2 additions & 2 deletions docs/node-template-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ the existence of your current git commit ID in the remote repository.
Assume you are in root directory of Substrate. Run:

```bash
cd .maintain/
cd scripts/ci/
./node-template-release.sh <output tar.gz file>
```

Expand Down Expand Up @@ -50,7 +50,7 @@ commit in Substrate remote repository, such as:
```

P.S: This step can be automated if we update `node-template-release` package in
`.maintain/node-template-release`.
`scripts/ci/node-template-release`.

4. Once the three `Cargo.toml`s are updated, compile and confirm that the Node Template builds. Then
commit the changes to a new branch in [Substrate Node Template](https://github.com/substrate-developer-hub/substrate-node-template), and make a PR.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LABEL io.parity.image.authors="[email protected]" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.title="parity/subkey" \
io.parity.image.description="Subkey: key generating utility for Substrate." \
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/.maintain/docker/subkey.Dockerfile" \
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/scripts/ci/docker/subkey.Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://github.com/paritytech/substrate/tree/${VCS_REF}/subkey"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LABEL io.parity.image.authors="[email protected]" \
io.parity.image.vendor="Parity Technologies" \
io.parity.image.title="parity/substrate" \
io.parity.image.description="Substrate: The platform for blockchain innovators." \
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/.maintain/docker/Dockerfile" \
io.parity.image.source="https://github.com/paritytech/substrate/blob/${VCS_REF}/scripts/ci/docker/Dockerfile" \
io.parity.image.revision="${VCS_REF}" \
io.parity.image.created="${BUILD_DATE}" \
io.parity.image.documentation="https://wiki.parity.io/Parity-Substrate"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ if [ "$#" -ne 1 ]; then
fi

PATH_TO_ARCHIVE=$1
cd $PROJECT_ROOT/.maintain/node-template-release
cd $PROJECT_ROOT/scripts/ci/node-template-release

cargo run $PROJECT_ROOT/bin/node-template $PROJECT_ROOT/$PATH_TO_ARCHIVE

0 comments on commit b797b89

Please sign in to comment.