Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add nightly ci #283

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
Loading