This repository has been archived by the owner on May 4, 2024. It is now read-only.
Pushing Move-on-aptos upstream #2113
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
# CI jobs to be run upon the code lands to the main branch or GitHub Action test branches. | |
name: ci-pre-land | |
on: | |
pull_request: | |
branches: [main, gha-test-*, aptos*] | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
changes-target-branch: ${{ steps.changes.outputs.changes-target-branch }} | |
any-changes-founds: ${{ steps.any-changes-found.outputs.changes-found }} | |
test-rust: ${{ steps.rust-changes.outputs.changes-found }} | |
steps: | |
- uses: actions/[email protected] | |
- name: Git Hooks and Checks | |
run: ./scripts/git-checks.sh | |
- id: changes | |
name: determine changes | |
uses: diem/actions/changes@faadd16607b77dfa2231a8f366883e01717b3225 | |
with: | |
workflow-file: ci.yml | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
- id: any-changes-found | |
name: determine if there are any files listed in the CHANGES_CHANGED_FILE_OUTPUTFILE. | |
run: | | |
res=true | |
if [[ ! -f "$CHANGES_CHANGED_FILE_OUTPUTFILE" ]] || [[ "$(cat "$CHANGES_CHANGED_FILE_OUTPUTFILE" | wc -l)" == 0 ]]; then | |
res=false; | |
fi | |
echo "::set-output name=changes-found::$(echo $res)"; | |
- id: rust-changes | |
name: find rust/cargo changes. | |
uses: diem/actions/matches@faadd16607b77dfa2231a8f366883e01717b3225 | |
with: | |
pattern: '^documentation\|^docker\|^scripts' | |
invert: "true" | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: prepare | |
# if: ${{ needs.prepare.outputs.any-changes-founds == 'true' }} | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- run: cargo install cargo-sort --locked | |
- run: scripts/rust_lint.sh --check | |
unit-test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
env: | |
# Default is 2mb which is not enough for Move compiler in debug mode, so we up it to 16mB | |
RUST_MIN_STACK: 16000000 | |
needs: prepare | |
# if: ${{ needs.prepare.outputs.test-rust == 'true' }} | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- name: Set Swap Space | |
uses: pierotofy/set-swap-space@master | |
with: | |
swap-size-gb: 10 | |
- name: run unit tests | |
run: cargo test --workspace --profile ci | |
- uses: ./.github/actions/build-teardown | |
hardhat-tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: prepare | |
env: | |
# Default is 2mb which is not enough for Move compiler in debug mode, so we up it to 16mB | |
RUST_MIN_STACK: 16000000 | |
# if: ${{ needs.prepare.outputs.test-rust == 'true' }} | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- name: compile and install move-cli | |
run: "cargo install --features evm-backend --path language/tools/move-cli" | |
- name: set up hardhat-move | |
working-directory: language/evm/hardhat-move | |
run: "npm install" | |
- name: compile hardhat-move | |
working-directory: language/evm/hardhat-move | |
run: "npm run build" | |
- name: set up hardhat | |
working-directory: language/evm/hardhat-examples | |
run: "./setup.sh" | |
- name: run hardhat tests | |
working-directory: language/evm/hardhat-examples | |
run: "npx hardhat test" | |
# TODO: reenable this once we figure a way to keep package-lock.json stable. | |
# - uses: ./.github/actions/build-teardown | |
move-cli-tests-evm: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: prepare | |
env: | |
# Default is 2mb which is not enough for Move compiler in debug mode, so we up it to 16mB | |
RUST_MIN_STACK: 16000000 | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- name: run EVM-based move cli tests | |
run: "echo skipped" | |
#run: "cargo test --features evm-backend -p move-cli --test build_testsuite_evm --test move_unit_tests_evm" TODO: reenable | |
move-unit-test-framework-tests-evm: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: prepare | |
env: | |
# Default is 2mb which is not enough for Move compiler in debug mode, so we up it to 16mB | |
RUST_MIN_STACK: 16000000 | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- name: run EVM-based move unit test framework tests | |
run: "echo skipped" | |
# run: "cargo test --features evm-backend -p move-unit-test --test move_unit_test_testsuite" TODO: reenable | |
diem-framework-build-all-packages: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: prepare | |
env: | |
# Default is 2mb which is not enough for Move compiler in debug mode, so we up it to 16mB | |
RUST_MIN_STACK: 16000000 | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- name: build Diem Framework Packages | |
run: "echo skipped" | |
#run: "language/documentation/examples/diem-framework/build_all.sh" TODO: reenable | |
diem-framework-test-all-packages: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: prepare | |
env: | |
# Default is 2mb which is not enough for Move compiler in debug mode, so we up it to 16mB | |
RUST_MIN_STACK: 16000000 | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- name: test Diem Framework Packages | |
run: "echo skipped" | |
# run: "language/documentation/examples/diem-framework/test_all.sh" TODO: reenable | |
diem-framework-prove-all-packages: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: prepare | |
env: | |
# Default is 2mb which is not enough for Move compiler in debug mode, so we up it to 16mB | |
RUST_MIN_STACK: 16000000 | |
steps: | |
- uses: actions/[email protected] | |
- uses: ./.github/actions/build-setup | |
- uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c | |
- name: prove Diem Framework Packages | |
run: "echo skipped" | |
# run: "language/documentation/examples/diem-framework/prove_all.sh" TODO: reenable | |
check-for-broken-links: | |
name: Check for broken links in files | |
runs-on: ubuntu-latest | |
needs: | |
- prepare | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby 2.6 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "2.6" | |
- name: Run Checks | |
run: "echo skipped" | |
# TODO: reenable | |
#run: | | |
# gem install awesome_bot | |
# # Don't look in git or target dirs. Don't check png, bib, tex, js, or shell files | |
# # We allow links to be redirects, allow duplicates, and we also allow Too Many Requests (429) errors | |
# find . -not \( -path "./.git*" -prune \) -not \( -path "./target" -prune \) -type f -not -name "*.png" -not -name "*.ai" -not -name "*.jpg" -not -name "*.svg" -not -name "*.sh" -not -name "*.bib" -not -name "*.tex" -not -name "*.js" -not -name "package-lock.json" | while read arg; do awesome_bot --allow-redirect --allow-dupe --allow 429 --skip-save-results $arg; done |