Skip to content

Commit

Permalink
Merge branch 'master' into oleg/ci_cd/#860
Browse files Browse the repository at this point in the history
  • Loading branch information
mateo-moon authored Aug 29, 2023
2 parents e60791f + 430edd7 commit 94d7c91
Show file tree
Hide file tree
Showing 524 changed files with 3,638 additions and 2,319 deletions.
16 changes: 0 additions & 16 deletions .github/pr-custom-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@ rules:
- ci
- release-engineering

- name: Audit rules
check_type: changed_files
condition:
include: ^polkadot/runtime\/(kusama|polkadot|common)\/.*|^polkadot/primitives/src\/.+\.rs$|^substrate/primitives/.*|^substrate/frame/.*
exclude: ^polkadot/runtime\/(kusama|polkadot)\/src\/weights\/.+\.rs$|^substrate\/frame\/.+\.md$
all_distinct:
- min_approvals: 1
teams:
- locks-review
- min_approvals: 1
teams:
- polkadot-review
- min_approvals: 2
teams:
- srlabs

- name: Core developers
check_type: changed_files
condition:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/auto-label-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# If the author of the issues is not a contributor to the project, label
# the issue with 'Z0-unconfirmed'

name: Label New Issues
on:
issues:
types: [opened]

jobs:
label-new-issues:
runs-on: ubuntu-latest
steps:
- name: Label drafts
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90 # 1.0.4
if: github.event.issue.author_association == 'NONE'
with:
add-labels: "I10-unconfirmed"
54 changes: 0 additions & 54 deletions .github/workflows/check-D-labels.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
API_BASE: https://api.github.com/repos
REPO: ${{ github.repository }}
RULES_PATH: labels/ruled_labels
CHECK_SPECS: "[DRAFT]specs_monorepo.yaml"
CHECK_SPECS: "specs_polkadot-sdk.yaml"
run: |
echo "REPO: ${REPO}"
echo "GITHUB_PR: ${GITHUB_PR}"
Expand All @@ -32,10 +32,6 @@ jobs:
# Temporary, before /~https://github.com/paritytech/labels/pull/29 is not merged
git clone /~https://github.com/paritytech/labels
cd labels
git fetch origin the-right-joyce-monorepo-labels
git checkout the-right-joyce-monorepo-labels
cd ..
# Fetch the labels for the PR under test
echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check licenses

on:
pull_request:

permissions:
packages: read

jobs:
check-licenses:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
repo: [polkadot, substrate, cumulus]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: actions/setup-node@v3.8.1
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
scope: "@paritytech"
- name: Check the licenses for ${{ matrix.repo }}
run: |
shopt -s globstar
echo "install"
npm install -g @paritytech/license-scanner@0.0.5
echo "run for ${{ matrix.repo }}"
cd ${{ matrix.repo }}
npx @paritytech/license-scanner scan \
--ensure-licenses=Apache-2.0 \
--ensure-licenses=GPL-3.0-only \
./**/*.rs
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 changes: 35 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
target/
**/target/
!polkadot.service
.cargo-remote.toml
.direnv/
.DS_Store
.env*
.idea
.local
.vscode
.DS_Store
/.cargo/config
polkadot_argument_parsing
**/node_modules
**/chains/
.wasm-binaries
*.bin
*.iml
.env
*.orig
*.rej
*.swp
**/._*

cargo_home
cargo_target_dir

**/.criterion/
**/*.rs.bk
**/chains/
**/hfuzz_target/
**/hfuzz_workspace/
**/node_modules
**/target/
**/wip/*.stderr
/.cargo/config
/.envrc
artifacts
bin/node-template/Cargo.lock
nohup.out
polkadot_argument_parsing
polkadot.*
pwasm-alloc/Cargo.lock
pwasm-libc/Cargo.lock
release-artifacts
release.json
rls*.log
runtime/wasm/target/
substrate.code-workspace
target/
145 changes: 138 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ variables:
NEXTEST_SUCCESS_OUTPUT: "final"
RELENG_SCRIPTS_BRANCH: "master"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.59"
RUSTY_CACHIER_SINGLE_BRANCH: master
RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true"
RUSTY_CACHIER_COMPRESSION_METHOD: zstd
NEXTEST_FAILURE_OUTPUT: immediate-final
NEXTEST_SUCCESS_OUTPUT: final
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.65"
DOCKER_IMAGES_VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"

default:
retry:
Expand Down Expand Up @@ -65,14 +72,20 @@ default:
# Ensure that RUSTFLAGS are set correctly
- echo $RUSTFLAGS

.common-before-script:
before_script:
- !reference [.job-switcher, before_script]
- !reference [.timestamp, before_script]
- !reference [.pipeline-stopper-vars, script]

.job-switcher:
before_script:
- if echo "$CI_DISABLED_JOBS" | grep -xF "$CI_JOB_NAME"; then echo "The job has been cancelled in CI settings"; exit 0; fi

.kubernetes-env:
image: "${CI_IMAGE}"
before_script:
# - !reference [.job-switcher, before_script]
- !reference [.common-before-script, before_script]
- !reference [.prepare-env, before_script]
tags:
- kubernetes-parity-build
Expand All @@ -84,9 +97,10 @@ default:
- rustup +nightly show
- cargo +nightly --version

# collecting vars for pipeline stopper
# they will be used if the job fails
.pipeline-stopper-vars:
script:
- !reference [.job-switcher, before_script]
- echo "Collecting env variables for the cancel-pipeline job"
- echo "FAILED_JOB_URL=${CI_JOB_URL}" > pipeline-stopper.env
- echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env
Expand All @@ -100,7 +114,7 @@ default:
.docker-env:
image: $CI_IMAGE
before_script:
- !reference [.job-switcher, before_script]
- !reference [.common-before-script, before_script]
- !reference [.prepare-env, before_script]
- !reference [.rust-info-script, script]
- !reference [.rusty-cachier, before_script]
Expand Down Expand Up @@ -133,7 +147,6 @@ default:
after_script:
- tar cfW dependencies.tar $CARGO_HOME $CARGO_TARGET_DIR


.common-refs:
rules:
- if: $CI_PIPELINE_SOURCE == "web"
Expand Down Expand Up @@ -216,6 +229,124 @@ include:
# zombienet jobs
- .gitlab/pipeline/zombienet.yml
# # timestamp handler
# - project: parity/infrastructure/ci_cd/shared
# ref: v0.2
# file: /common/timestamp.yml
- project: parity/infrastructure/ci_cd/shared
ref: v0.2
file: /common/timestamp.yml

# This job cancels the whole pipeline if any of provided jobs fail.
# In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests
# to fail the pipeline as soon as possible to shorten the feedback loop.
.cancel-pipeline-template:
stage: .post
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
when: on_failure
variables:
PROJECT_ID: "${CI_PROJECT_ID}"
PROJECT_NAME: "${CI_PROJECT_NAME}"
PIPELINE_ID: "${CI_PIPELINE_ID}"
FAILED_JOB_URL: "${FAILED_JOB_URL}"
FAILED_JOB_NAME: "${FAILED_JOB_NAME}"
PR_NUM: "${PR_NUM}"
trigger:
project: "parity/infrastructure/ci_cd/pipeline-stopper"

remove-cancel-pipeline-message:
stage: .post
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
variables:
PROJECT_ID: "${CI_PROJECT_ID}"
PROJECT_NAME: "${CI_PROJECT_NAME}"
PIPELINE_ID: "${CI_PIPELINE_ID}"
FAILED_JOB_URL: "https://gitlab.com"
FAILED_JOB_NAME: "nope"
PR_NUM: "${CI_COMMIT_REF_NAME}"
trigger:
project: "parity/infrastructure/ci_cd/pipeline-stopper"
# need to copy jobs this way because otherwise gitlab will wait
# for all 3 jobs to finish instead of cancelling if one fails
cancel-pipeline-test-linux-stable1:
extends: .cancel-pipeline-template
needs:
- job: "test-linux-stable 1/3"

cancel-pipeline-test-linux-stable2:
extends: .cancel-pipeline-template
needs:
- job: "test-linux-stable 2/3"

cancel-pipeline-test-linux-stable3:
extends: .cancel-pipeline-template
needs:
- job: "test-linux-stable 3/3"

cancel-pipeline-test-linux-stable-additional-tests:
extends: .cancel-pipeline-template
needs:
- job: "test-linux-stable-additional-tests"

cancel-pipeline-test-linux-stable-slow:
extends: .cancel-pipeline-template
needs:
- job: "test-linux-stable-slow"

cancel-pipeline-cargo-check-benches1:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-benches 1/2"

cancel-pipeline-cargo-check-benches2:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-benches 2/2"

cancel-pipeline-test-linux-stable-int:
extends: .cancel-pipeline-template
needs:
- job: test-linux-stable-int

cancel-pipeline-cargo-check-each-crate-1:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-each-crate 1/6"

cancel-pipeline-cargo-check-each-crate-2:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-each-crate 2/6"

cancel-pipeline-cargo-check-each-crate-3:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-each-crate 3/6"

cancel-pipeline-cargo-check-each-crate-4:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-each-crate 4/6"

cancel-pipeline-cargo-check-each-crate-5:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-each-crate 5/6"

cancel-pipeline-cargo-check-each-crate-6:
extends: .cancel-pipeline-template
needs:
- job: "cargo-check-each-crate 6/6"

cancel-pipeline-cargo-check-each-crate-macos:
extends: .cancel-pipeline-template
needs:
- job: cargo-check-each-crate-macos

cancel-pipeline-check-tracing:
extends: .cancel-pipeline-template
needs:
- job: check-tracing

cancel-pipeline-cargo-clippy:
extends: .cancel-pipeline-template
needs:
- job: cargo-clippy
Loading

0 comments on commit 94d7c91

Please sign in to comment.