|
@@ -0,0 +1,72 @@
|
|
|
+name: CI
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ # Run in PRs and for bors, but not on master.
|
|
|
+ branches:
|
|
|
+ - 'auto'
|
|
|
+ - 'try'
|
|
|
+ pull_request:
|
|
|
+ branches:
|
|
|
+ - 'master'
|
|
|
+ schedule:
|
|
|
+ - cron: '6 6 * * *' # At 6:06 UTC every day.
|
|
|
+
|
|
|
+env:
|
|
|
+ CARGO_UNSTABLE_SPARSE_REGISTRY: 'true'
|
|
|
+
|
|
|
+jobs:
|
|
|
+ build:
|
|
|
+ runs-on: ${{ matrix.os }}
|
|
|
+ env:
|
|
|
+ RUST_BACKTRACE: 1
|
|
|
+ HOST_TARGET: ${{ matrix.host_target }}
|
|
|
+ strategy:
|
|
|
+ fail-fast: false
|
|
|
+ matrix:
|
|
|
+ include:
|
|
|
+ - os: windows-latest
|
|
|
+ host_target: i686-pc-windows-msvc
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+
|
|
|
+ # Cache the global cargo directory, but NOT the local `target` directory which
|
|
|
+ # we cannot reuse anyway when the nightly changes (and it grows quite large
|
|
|
+ # over time).
|
|
|
+ - name: Add cache for cargo
|
|
|
+ id: cache
|
|
|
+ uses: actions/cache@v3
|
|
|
+ with:
|
|
|
+ path: |
|
|
|
+ # Taken from <https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci>.
|
|
|
+ ~/.cargo/bin
|
|
|
+ ~/.cargo/registry/index
|
|
|
+ ~/.cargo/registry/cache
|
|
|
+ ~/.cargo/git/db
|
|
|
+ # contains package information of crates installed via `cargo install`.
|
|
|
+ ~/.cargo/.crates.toml
|
|
|
+ ~/.cargo/.crates2.json
|
|
|
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
+ restore-keys: ${{ runner.os }}-cargo
|
|
|
+
|
|
|
+ - name: Install rustup-toolchain-install-master
|
|
|
+ if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
|
|
+ shell: bash
|
|
|
+ run: |
|
|
|
+ cargo install -f rustup-toolchain-install-master
|
|
|
+ - name: Install "master" toolchain
|
|
|
+ shell: bash
|
|
|
+ run: |
|
|
|
+ if [[ ${{ github.event_name }} == 'schedule' ]]; then
|
|
|
+ echo "Building against latest rustc git version"
|
|
|
+ git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version
|
|
|
+ fi
|
|
|
+ ./miri toolchain --host ${{ matrix.host_target }}
|
|
|
+ - name: Show Rust version
|
|
|
+ run: |
|
|
|
+ rustup show
|
|
|
+ rustc -Vv
|
|
|
+ cargo -V
|
|
|
+ - name: Test
|
|
|
+ run: |
|
|
|
+ MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" cargo +nightly miri test --package dioxus-core --test miri_stress -- --exact --nocapture
|