From f80a5e3e88a274e007459fbc094bca85214ac757 Mon Sep 17 00:00:00 2001 From: SwayStar123 Date: Tue, 13 Aug 2024 13:24:08 +0530 Subject: [PATCH 1/4] add nightly ci --- .github/workflows/nightly.yml | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..d1199535 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,56 @@ +name: Nightly Tests + +on: + schedule: + - cron: '0 0 * * *' # Run every day at midnight UTC + +env: + CARGO_TERM_COLOR: always + REGISTRY: ghcr.io + +jobs: + nightly-tests: + runs-on: ubuntu-latest + strategy: + matrix: + job: [build-sway-lib, forc-inline-tests, contributing-book, build-forc-doc-sway-libs, build-examples] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + components: rustfmt + + - name: Init cache + uses: Swatinem/rust-cache@v2 + + - name: Install Fuel toolchain + uses: FuelLabs/action-fuel-toolchain@v0.6.0 + with: + toolchain: nightly + + - name: Run ${{ matrix.job }} + run: | + if [ "${{ matrix.job }}" = "build-sway-lib" ]; then + forc fmt --path libs --check + cargo fmt --manifest-path tests/Cargo.toml --verbose --check + forc build --path libs --release --locked + forc build --path tests --release --locked + cargo test --manifest-path tests/Cargo.toml + elif [ "${{ matrix.job }}" = "forc-inline-tests" ]; then + forc build --path libs --release --locked && forc test --path libs --locked + forc build --path tests --release --locked && forc test --path tests --locked + elif [ "${{ matrix.job }}" = "contributing-book" ]; then + forc fmt --path docs/contributing-book/src/code --check + forc build --path docs/contributing-book/src/code --release + elif [ "${{ matrix.job }}" = "build-forc-doc-sway-libs" ]; then + forc doc --manifest-path libs + elif [ "${{ matrix.job }}" = "build-examples" ]; then + forc fmt --path examples --check + cargo fmt --manifest-path examples/Cargo.toml --verbose --check + forc build --path examples --release --locked + cargo test --manifest-path examples/Cargo.toml + fi \ No newline at end of file From 9c45e88a0c453697540e2002bd6b0eb63fe132e8 Mon Sep 17 00:00:00 2001 From: SwayStar123 Date: Tue, 13 Aug 2024 13:28:57 +0530 Subject: [PATCH 2/4] add manual dispatch --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d1199535..e163a822 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,6 +3,7 @@ name: Nightly Tests on: schedule: - cron: '0 0 * * *' # Run every day at midnight UTC + workflow_dispatch: env: CARGO_TERM_COLOR: always From 7426835d41bb9e2b534514afa42be1d96ec3b8b8 Mon Sep 17 00:00:00 2001 From: SwayStar123 Date: Tue, 13 Aug 2024 13:31:55 +0530 Subject: [PATCH 3/4] temporarily add on pull_request --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e163a822..2ceffb54 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,7 @@ name: Nightly Tests on: schedule: - cron: '0 0 * * *' # Run every day at midnight UTC - workflow_dispatch: + pull_request: env: CARGO_TERM_COLOR: always From 6c4f5b393d99a84b36ad7825a84fa0ff5861789f Mon Sep 17 00:00:00 2001 From: SwayStar123 Date: Tue, 13 Aug 2024 13:34:27 +0530 Subject: [PATCH 4/4] remove --locked --- .github/workflows/nightly.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2ceffb54..cd1d7242 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -38,12 +38,12 @@ jobs: if [ "${{ matrix.job }}" = "build-sway-lib" ]; then forc fmt --path libs --check cargo fmt --manifest-path tests/Cargo.toml --verbose --check - forc build --path libs --release --locked - forc build --path tests --release --locked + forc build --path libs --release + forc build --path tests --release cargo test --manifest-path tests/Cargo.toml elif [ "${{ matrix.job }}" = "forc-inline-tests" ]; then - forc build --path libs --release --locked && forc test --path libs --locked - forc build --path tests --release --locked && forc test --path tests --locked + forc build --path libs --release && forc test --path libs + forc build --path tests --release && forc test --path tests elif [ "${{ matrix.job }}" = "contributing-book" ]; then forc fmt --path docs/contributing-book/src/code --check forc build --path docs/contributing-book/src/code --release @@ -52,6 +52,6 @@ jobs: elif [ "${{ matrix.job }}" = "build-examples" ]; then forc fmt --path examples --check cargo fmt --manifest-path examples/Cargo.toml --verbose --check - forc build --path examples --release --locked + forc build --path examples --release cargo test --manifest-path examples/Cargo.toml fi \ No newline at end of file