Skip to content

Commit

Permalink
chore: everyday release testing + test-fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Jan 13, 2022
1 parent 1693da0 commit 88c2712
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 3 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Rust

on:
schedule:
- cron: '0 0 * * *' # every day at midnight

env:
CARGO_TERM_COLOR: always
# Disable incremental compilation.
#
# Incremental compilation is useful as part of an edit-build-test-edit cycle,
# as it lets the compiler avoid recompiling code that hasn't changed. However,
# on CI, we're not making small edits; we're almost always building the entire
# project from scratch. Thus, incremental compilation on CI actually
# introduces *additional* overhead to support making future builds
# faster...but no future builds will ever occur in any given CI environment.
#
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
# for details.
CARGO_INCREMENTAL: 0
# Allow more retries for network requests in cargo (downloading crates) and
# rustup (installing toolchains). This should help to reduce flaky CI failures
# from transient network timeouts or other issues.
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
# Don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short

jobs:

test:
name: Test Rust ${{matrix.toolchain}} on ${{matrix.os}}
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
toolchain: [stable, nightly]
os: [ubuntu]
steps:
- uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --release --profile=release
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ fn sub_non_existing() {

// Substitution between two module ID's that already exist in the module table.
// This is currently not supported and should cause a panic
#[should_panic]
#[cfg_attr(debug_assertions, should_panic)]
#[test]
fn sub_existing() {
let id1 = make_id(10, ident_str!("Name1"));
Expand Down
11 changes: 9 additions & 2 deletions fastx_programmability/adapter/tests/cli_testsuite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@

//use move_cli::sandbox::commands::test;

use std::path::{Path, PathBuf};
use std::path::Path;

fn run_all(args_path: &Path) -> datatest_stable::Result<()> {
let _use_temp_dir = !args_path.parent().unwrap().join("NO_TEMPDIR").exists();
let fastx_binary = PathBuf::from("../../target/debug/fastx");
let target =
std::env::var_os("CARGO_BUILD_TARGET_DIR").unwrap_or_else(|| "../../target".into());
#[cfg(debug_assertions)]
let profile: String = "debug".into();
#[cfg(not(debug_assertions))]
let profile: String = "release".into();

let fastx_binary = Path::new(&target).join(profile).join("fastx");
assert!(fastx_binary.exists(), "No such binary {:?}", fastx_binary);
// TODO: crashes inside diem code with `Error: prefix not found` when running `cargo test`
/*test::run_one(
Expand Down

0 comments on commit 88c2712

Please sign in to comment.