Skip to content

Commit

Permalink
feat: update the CI to use paritytech/ci-linux:production (#73)
Browse files Browse the repository at this point in the history
* feat: update the CI to use paritytech/ci-linux:production

* ci: execute fmt as a fail fast job

* fmt: format to test the CI

* feat: remove the check job
  • Loading branch information
lrazovic committed Aug 23, 2023
1 parent 9748560 commit b4579cc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 31 deletions.
50 changes: 24 additions & 26 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Check Set-Up & Build
on:
pull_request:
branches: [main]
types: [ready_for_review, labeled]
types: [synchronize, reopened, ready_for_review, labeled]
label:
types: [created, deleted]
# Allows you to run this workflow manually from the Actions tab
Expand All @@ -15,46 +15,44 @@ env:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check:
fmt:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
container:
image: paritytech/ci-linux:production
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Set-Up
run: sudo apt update && sudo apt install -y protobuf-compiler clang

- name: Install Rust
# Using the version specified in the rust-toolchain.toml
uses: actions-rust-lang/setup-rust-toolchain@v1

# Fail fast: check formatting first as it doesn't require compilation
- name: Check formatting
run: cargo fmt --all --check

- name: Check Build Parachain Runtime
run: |
SKIP_WASM_BUILD=1 cargo check --release -p polimec-parachain-runtime
- name: Check the formatting
run: cargo +nightly fmt --all --check

test:
# This job runs only if `check` is successful
needs: check
# The type of runner that the job will run on
needs: check
runs-on: ubuntu-22.04
container:
image: paritytech/ci-linux:production
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Required by actions/cache@v3
- name: Set-Up
run: sudo apt update && sudo apt install -y protobuf-compiler clang
run: apt update && apt install -y nodejs

- name: Install Rust
# Using the version specified in the rust-toolchain.toml
uses: actions-rust-lang/setup-rust-toolchain@v1
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Test the Parachain
run: |
SKIP_WASM_BUILD=1 cargo test --release
run: SKIP_WASM_BUILD=1 cargo test --locked
6 changes: 1 addition & 5 deletions pallets/funding/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5938,10 +5938,7 @@ mod funding_end {
assert_eq!(finished_project.get_project_details().status, ProjectStatus::FundingSuccessful);
test_env.advance_time(<TestRuntime as Config>::SuccessToSettlementTime::get()).unwrap();

assert_matches!(
finished_project.get_project_details().cleanup,
Cleaner::Success(CleanerState::Initialized(_))
);
assert_matches!(finished_project.get_project_details().cleanup, Cleaner::Success(CleanerState::Initialized(_)));
test_ct_created_for(&test_env, project_id);

test_env.advance_time(10u64).unwrap();
Expand Down Expand Up @@ -6497,5 +6494,4 @@ mod testing_macros {
};
}
pub(crate) use extract_from_event;

}

0 comments on commit b4579cc

Please sign in to comment.