-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +0,0 @@ | ||
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837012/Code+style+testing | ||
# Nested workflow for checks related to formatting Rust code | ||
|
||
name: codestyle | ||
|
||
# Triger: only call from main workflow(re-usable workflows) | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
rustfmt: | ||
runs-on: [ ci ] | ||
steps: | ||
- name: Clean Workspace | ||
uses: AutoModality/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Read .env file | ||
uses: xom9ikk/[email protected] | ||
- name: Install toolchain version from .env | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
targets: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
- name: Run cargo fmt | ||
run: cargo fmt -- --check # In that mode it returns only exit code. | ||
- name: Cargo fmt state | ||
if: success() | ||
run: echo "Nothing to do. Command 'cargo fmt -- --check' returned exit code 0." | ||
|
||
yarn_eslint: | ||
runs-on: [ ci ] | ||
steps: | ||
- name: Clean Workspace | ||
uses: AutoModality/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
- name: Install modules | ||
run: cd js-packages && yarn | ||
- name: Run ESLint | ||
# run: cd js-packages && yarn lint --max-warnings=0 | ||
run: cd js-packages && yarn lint | ||
|
||
clippy: | ||
runs-on: [ ci ] | ||
steps: | ||
- name: Clean Workspace | ||
uses: AutoModality/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Install substrate dependencies | ||
run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler | ||
- name: Read .env file | ||
uses: xom9ikk/[email protected] | ||
- name: Install toolchain version from .env | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
targets: wasm32-unknown-unknown | ||
components: rustfmt, clippy | ||
- name: Run cargo check | ||
run: cargo clippy --features=quartz-runtime,unique-runtime,try-runtime --tests -- -Dwarnings | ||
env: | ||
SKIP_WASM_BUILD: '1' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +0,0 @@ | ||
# Integration test in --dev mode | ||
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests | ||
name: yarn-dev | ||
|
||
# Triger: only call from main workflow(re-usable workflows) | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
||
dev_build_int_tests: | ||
# The type of runner that the job will run on | ||
runs-on: [ ci ] | ||
timeout-minutes: 1380 | ||
|
||
name: ${{ matrix.network }} | ||
|
||
continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false. | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- network: "opal" | ||
- network: "quartz" | ||
- network: "unique" | ||
|
||
steps: | ||
- name: Clean Workspace | ||
uses: AutoModality/[email protected] | ||
|
||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.head_ref }} #Checking out head commit | ||
|
||
- name: Read .env file | ||
uses: xom9ikk/[email protected] | ||
|
||
- name: Generate ENV related extend file for docker-compose | ||
uses: cuchi/[email protected] | ||
with: | ||
template: .docker/docker-compose.tmp-dev.j2 | ||
output_file: .docker/docker-compose.${{ matrix.network }}.yml | ||
variables: | | ||
NETWORK=${{ matrix.network }} | ||
- name: Show build configuration | ||
run: cat .docker/docker-compose.${{ matrix.network }}.yml | ||
|
||
- name: Build the stack | ||
run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
|
||
- name: Run tests | ||
working-directory: js-packages/tests | ||
run: | | ||
yarn install | ||
yarn add mochawesome | ||
../scripts/wait_for_first_block.sh | ||
echo "Ready to start tests" | ||
NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW} | ||
env: | ||
RPC_URL: http://127.0.0.1:9944/ | ||
|
||
- name: Test Report | ||
uses: phoenix-actions/test-reporting@v15 | ||
id: test-report | ||
if: success() || failure() # run this step even if previous step failed | ||
with: | ||
name: int test results - ${{ matrix.network }} # Name of the check run which will be created | ||
path: js-packages/tests/mochawesome-report/test-*.json # Path to test results | ||
reporter: mochawesome-json | ||
fail-on-error: 'false' | ||
|
||
- name: Read output variables | ||
run: | | ||
echo "url is ${{ steps.test-report.outputs.runHtmlUrl }}" | ||
- name: Run benchmark mintFee tests | ||
working-directory: js-packages/scripts | ||
run: | | ||
yarn install | ||
node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/mintFee/index.ts | ||
- name: Run benchmark opsFee tests | ||
working-directory: js-packages/scripts | ||
run: | | ||
yarn install | ||
node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/opsFee/index.ts | ||
- name: Stop running containers | ||
if: always() # run this step always | ||
run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down | ||
|
||
- name: Remove builder cache | ||
if: always() # run this step always | ||
run: | | ||
docker builder prune -f -a | ||
docker system prune -f | ||
docker image prune -f -a | ||
# check: | ||
# if: always() | ||
# runs-on: [ ci ] | ||
# needs: | ||
# - dev_build_int_tests | ||
|
||
# steps: | ||
# - name: Install python3 | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.10' | ||
|
||
# - name: Decide whether the needed jobs succeeded or failed | ||
# uses: re-actors/[email protected] | ||
# with: | ||
# jobs: ${{ toJSON(needs) }} | ||