-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI - PR checks #13
Merged
Merged
CI - PR checks #13
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dc64816
CI PR checks
shunsukew 7802d83
up
shunsukew aab494e
fix
shunsukew 73e78b2
fix
shunsukew 80abad3
remove cache
shunsukew c427d68
up
shunsukew 83cc8f5
up
shunsukew d2e8d44
test
shunsukew a760e9b
up
shunsukew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: PR checks | ||
on: | ||
push: | ||
workflow_dispatch: | ||
jobs: | ||
checks-and-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install & display rust toolchain | ||
run: | | ||
rustup show | ||
rustup component add rust-src | ||
|
||
- name: Check targets are installed correctly | ||
run: rustup target list --installed | ||
|
||
- name: Cache Crates | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo | ||
key: ${{ runner.os }}-rust-${{ hashFiles('rust-toolchain.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-rust | ||
|
||
- name: Check if cargo-contract exists | ||
id: check-cargo-contract | ||
continue-on-error: true | ||
run: cargo contract --version | ||
|
||
- name: Install cargo contract | ||
if: ${{ steps.check-cargo-contract.outcome == 'failure' }} | ||
run: | | ||
sudo apt-get install binaryen | ||
cargo install cargo-dylint dylint-link | ||
# Until 2.0.0 official release, we need to specify --version expressly | ||
cargo install --force --locked cargo-contract --version 2.0.0-rc | ||
|
||
- name: Compile checks | ||
run: | | ||
manifest_paths=`find uniswap-v2/contracts -type f -name Cargo.toml` | ||
echo $manifest_paths | ||
for manifest_path in $manifest_paths; do | ||
echo $manifest_path | ||
cargo contract check --manifest-path $manifest_path | ||
done | ||
|
||
- name: test | ||
run: cargo contract test | ||
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From use-ink/cargo-contract#958,
cargo contract test
is removed. Better usecargo test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HyunggyuJang This will have to be updated when this repo go to cargo contract 2.0 & ink! 4.0
But right now in cargo contract v2.0.0-rc.1 this is not removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks for the clarification!