-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Merge astar-frame. * Fix compiling. * Update license check workflow. * Code coverage workflow. * Add runtime deps to workspace. * Deps fix: integration tests and collator needs runtime std. * Fix license check CI. * Cancel previous workflow runs on new PR push. * Run tests coverage on self-hosted. * Revert. * Add coverage excludes. * Code coverage has different trigger conditions. * Update code coverage args. * Cancel previous code coverage run on new job.
- Loading branch information
Showing
169 changed files
with
36,265 additions
and
377 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This file is part of Astar. | ||
|
||
// Copyright (C) 2019-2023 Stake Technologies Pte.Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. |
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 |
---|---|---|
|
@@ -7,6 +7,16 @@ on: | |
- v[0-9]+.[0-9]+.[0-9]+* | ||
workflow_dispatch: | ||
jobs: | ||
clean-up-actions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
# Only cancel non-master branch runs | ||
if: ${{ github.ref != 'refs/heads/master' }} | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
compile-and-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Code coverage | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
workflow_dispatch: | ||
jobs: | ||
clean-up-actions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
# Only cancel non-master branch runs | ||
if: ${{ github.ref != 'refs/heads/master' }} | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
coverage: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install & display rust toolchain | ||
run: rustup show | ||
|
||
- name: Check targets are installed correctly | ||
run: rustup target list --installed | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
- name: Install deps | ||
run: sudo apt -y install protobuf-compiler | ||
|
||
- name: Run all tests & Generate report | ||
uses: actions-rs/[email protected] | ||
with: | ||
version: 0.22.0 | ||
args: '--workspace -e astar-collator xcm-tools local-runtime shibuya-runtime shiden-runtime astar-runtime integration-tests --exclude-files vendor/* bin/* runtime/* tests/* **/mock.rs **/weights.rs' | ||
out-type: Xml | ||
|
||
- name: Code Coverage Summary Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: cobertura.xml | ||
badge: true | ||
fail_below_min: true | ||
format: markdown | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '50 80' | ||
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md | ||
|
||
- name: Archive code coverage results | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: code-coverage-report | ||
path: cobertura.xml |
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,6 +1,16 @@ | ||
name: Static Analysis | ||
on: [push, workflow_dispatch] | ||
jobs: | ||
clean-up-actions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
# Only cancel non-master branch runs | ||
if: ${{ github.ref != 'refs/heads/master' }} | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
fmt: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
|
@@ -64,7 +74,7 @@ jobs: | |
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check license | ||
- name: Check license | ||
uses: viperproject/check-license-header@v2 | ||
with: | ||
path: ./ | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,17 @@ on: | |
- v[0-9]+.[0-9]+.[0-9]+* | ||
workflow_dispatch: | ||
jobs: | ||
run-tests: | ||
clean-up-actions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
# Only cancel non-master branch runs | ||
if: ${{ github.ref != 'refs/heads/master' }} | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
test-runtimes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free disk space | ||
|
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
Oops, something went wrong.