This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
Add migration warnings to README #290
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 CI Tries to be both simple and effective. It is inspired by: | |
# https://github.com/marketplace/actions/rust-cache | |
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659 | |
# https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml | |
name: Rust Checks | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
check-cargo-toml-format: | |
name: "Check Cargo.toml files format" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# With rustup's nice new toml format, we just need to run rustup show to install the toolchain | |
# https://github.com/actions-rs/toolchain/issues/126#issuecomment-782989659 | |
- name: Setup Rust toolchain | |
run: rustup show | |
- name: Check Cargo.toml files format with toml_sort | |
run: chmod u+x ./scripts/check-cargo-toml-files-format.sh && ./scripts/check-cargo-toml-files-format.sh | |
check-rust-fmt: | |
name: Check rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup rust toolchain | |
run: rustup show | |
- name: Run cargo fmt check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -- --check | |
cargo-check: | |
name: Cargo check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install tooling | |
run: | | |
sudo apt-get install -y protobuf-compiler | |
protoc --version | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Setup rust toolchain | |
run: rustup show | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v1 | |
- name: Run cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
check-copyright: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Find un-copyrighted files | |
run: | | |
find . -name '*.rs' -not -path "*/parachain-template/*" -exec grep -H -E -o -c Copyright {} \; | grep ':0' || true | |
FILECOUNT=$(find . -name '*.rs' -not -path "*/parachain-template/*" -exec grep -H -E -o -c 'Copyright' {} \; | grep -c ':0' || true) | |
if [[ $FILECOUNT -eq 0 ]]; then | |
true | |
else | |
false | |
fi |