Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
CI: add pontemapi caching (#220)
Browse files Browse the repository at this point in the history
* add pontemapi/target to .gitignore

* update Cargo.lock

* CI: add pontemapi caching support for all the jobs

* comment out windows-only CI steps, as win platform is not supported

* simplify names

* update cargo.lock
  • Loading branch information
mkurnikov authored Feb 21, 2022
1 parent 58b39a4 commit 20619e2
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 144 deletions.
125 changes: 68 additions & 57 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ jobs:
override: true
components: rustfmt, clippy

- name: Rusty cache
- name: Rust cache (pontemapi)
uses: Swatinem/rust-cache@v1
with:
working-directory: ./pontem/pontemapi/
cache-on-failure: true

- name: Rust cache (root)
uses: Swatinem/rust-cache@v1

- name: Check formatting
Expand All @@ -34,7 +40,7 @@ jobs:
args: --tests --examples -- -Dwarnings

tests:
name: Units (${{ matrix.name }})
name: tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -60,14 +66,14 @@ jobs:
with:
submodules: recursive

- name: Restore from cache and run vcpkg
if: ${{ matrix.platform == 'win' }}
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: openssl
vcpkgDirectory: ${{github.workspace}}/3rdparty/vcpkg
vcpkgTriplet: ${{ matrix.triplet }}
vcpkgGitCommitId: 71422c627264daedcbcd46f01f1ed0dcd8460f1b
# - name: Restore from cache and run vcpkg
# if: ${{ matrix.platform == 'win' }}
# uses: lukka/run-vcpkg@v7
# with:
# vcpkgArguments: openssl
# vcpkgDirectory: ${{github.workspace}}/3rdparty/vcpkg
# vcpkgTriplet: ${{ matrix.triplet }}
# vcpkgGitCommitId: 71422c627264daedcbcd46f01f1ed0dcd8460f1b

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -76,32 +82,25 @@ jobs:
profile: minimal
override: true

- name: Rusty cache
- name: Rust cache (pontemapi)
uses: Swatinem/rust-cache@v1

# Clearing cache "~/.move/" before testing
- name: Build, dove clean --global
uses: actions-rs/cargo@v1
with:
command: run
args: clean --global
key: pontemapi
working-directory: ./pontem/pontemapi/
cache-on-failure: true

# Download MoveStdlib
# Preliminary preparation for the "cargo test" in multithreading
# Do not delete it, otherwise the tests will not work in multithreaded mode.
- name: Download MoveStdlib
uses: actions-rs/cargo@v1
- name: Rust cache (root)
uses: Swatinem/rust-cache@v1
with:
command: test
args: test_cmd_dove_run_with_params
key: root

- name: Test All
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --all --all-features
args: --no-fail-fast --all --all-features -- --test-threads=1

- name: Upload artifact
- name: Upload dove debug binary to use in subsequent jobs
uses: actions/upload-artifact@v2
with:
name: dove-${{ matrix.name }}
Expand All @@ -111,7 +110,7 @@ jobs:

install:
needs: clippy
name: install (${{ matrix.name }})
name: cargo install (${{ matrix.name }})
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -131,14 +130,14 @@ jobs:
with:
submodules: recursive

- name: Restore from cache and run vcpkg
if: ${{ matrix.platform == 'win' }}
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: openssl
vcpkgDirectory: ${{github.workspace}}/3rdparty/vcpkg
vcpkgTriplet: ${{ matrix.triplet }}
vcpkgGitCommitId: 71422c627264daedcbcd46f01f1ed0dcd8460f1b
# - name: Restore from cache and run vcpkg
# if: ${{ matrix.platform == 'win' }}
# uses: lukka/run-vcpkg@v7
# with:
# vcpkgArguments: openssl
# vcpkgDirectory: ${{github.workspace}}/3rdparty/vcpkg
# vcpkgTriplet: ${{ matrix.triplet }}
# vcpkgGitCommitId: 71422c627264daedcbcd46f01f1ed0dcd8460f1b

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -147,22 +146,31 @@ jobs:
profile: minimal
override: true

- name: Rusty cache
- name: Rust cache (pontemapi)
uses: Swatinem/rust-cache@v1
with:
key: pontemapi
working-directory: ./pontem/pontemapi/
cache-on-failure: true

- name: Rust cache (root)
uses: Swatinem/rust-cache@v1
with:
key: root
cache-on-failure: true

- name: Build & Install Dove
uses: actions-rs/cargo@v1
with:
command: install
args: --path=dove
args: --path=dove --force

proover:
dove_build:
needs: tests
name: proover (${{ matrix.name }})
name: dove build | build --doc | test (${{ matrix.name }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
fail-fast: false
matrix:
include:
- name: macos
Expand All @@ -176,12 +184,6 @@ jobs:
with:
submodules: recursive

- name: Install Boogie
uses: pontem-network/get-boogie@main
with:
ref: 927c229cd8dfa6dcd50ba84811f80d10496c76d2
token: ${{ secrets.GITHUB_TOKEN }}

- name: Download artifact
uses: actions/download-artifact@v2
with:
Expand All @@ -190,15 +192,18 @@ jobs:
- name: Prepare dove
run: chmod +x ./bin/dove && echo "./bin" >> $GITHUB_PATH

- name: Proove move-stdlib
run: dove prove -p=dove/resources/for_tests/move-stdlib/
- run: dove build --path ./dove/resources/for_tests/move-stdlib
- run: dove build --doc --path ./dove/resources/for_tests/move-stdlib
- run: dove test --path ./dove/resources/for_tests/move-stdlib


builds:
dove_prove:
needs: tests
name: Builds (${{ matrix.name }})
name: dove prove (${{ matrix.name }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
fail-fast: true
matrix:
include:
- name: macos
Expand All @@ -212,6 +217,12 @@ jobs:
with:
submodules: recursive

- name: Install Boogie
uses: pontem-network/get-boogie@main
with:
ref: 927c229cd8dfa6dcd50ba84811f80d10496c76d2
token: ${{ secrets.GITHUB_TOKEN }}

- name: Download artifact
uses: actions/download-artifact@v2
with:
Expand All @@ -220,14 +231,14 @@ jobs:
- name: Prepare dove
run: chmod +x ./bin/dove && echo "./bin" >> $GITHUB_PATH

- run: dove build --path ./dove/resources/for_tests/move-stdlib
- run: dove build --doc --path ./dove/resources/for_tests/move-stdlib
- run: dove test --path ./dove/resources/for_tests/move-stdlib
- name: Prove move-stdlib
run: dove prove -p=dove/resources/for_tests/move-stdlib/

integration:
dove_node_integration:
needs: tests
name: Integration (${{ matrix.name }})
name: Node Integration tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}
if: ${{ false }}

strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/pontem/pontemapi/target

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down
Loading

0 comments on commit 20619e2

Please sign in to comment.