diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..cd1d7242 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,57 @@ +name: Nightly Tests + +on: + schedule: + - cron: '0 0 * * *' # Run every day at midnight UTC + pull_request: + +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 + forc build --path tests --release + cargo test --manifest-path tests/Cargo.toml + elif [ "${{ matrix.job }}" = "forc-inline-tests" ]; then + 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 + 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 + cargo test --manifest-path examples/Cargo.toml + fi \ No newline at end of file