-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from pendulum-chain/add-ci-master
Add CI for running cargo test
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
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,65 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
name: continuous-integration-test | ||
jobs: | ||
ci: | ||
runs-on: ubuntu-20.04 | ||
env: | ||
RUST_BACKTRACE: full | ||
# Make sure CI fails on all warnings, including Clippy lints | ||
RUSTFLAGS: "-Dwarnings" | ||
|
||
steps: | ||
- name: Freeing up more disk space | ||
run: | | ||
free -h | ||
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android | ||
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf /usr/local/share/boost | ||
sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
sudo apt-get remove -y 'php.*' --fix-missing | ||
sudo apt-get remove -y '^mongodb-.*' --fix-missing | ||
sudo apt-get remove -y '^mysql-.*' --fix-missing | ||
sudo apt-get clean | ||
df -h | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install package | ||
run: | | ||
sudo docker image prune --all --force | ||
echo 'APT::Get::Always-Include-Phased-Updates "false";' | sudo tee /etc/apt/apt.conf.d/99-phased-updates | ||
sudo apt-get update && sudo apt-get upgrade -y | ||
sudo apt-get install -y protobuf-compiler libprotobuf-dev | ||
- name: Setup Rust toolchain | ||
# Call `rustup show` as a hack so that the toolchain defined in rust-toolchain.toml is installed | ||
run: rustup show | ||
|
||
- name: Use Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
key: "ubuntu-20.04-cargo-${{ hashFiles('**/Cargo.lock') }}" | ||
shared-key: "shared" | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --all-features | ||
|
||
- name: Test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features |