ci: build all branches #246
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: | |
- '*' | |
- '!gh-pages' | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
MINGW_URL: https://ci-mirrors.rust-lang.org/rustc | |
MIRIFLAGS: -Zmiri-disable-isolation | |
strategy: | |
matrix: | |
target: [x86_64-pc-windows-msvc, i686-pc-windows-msvc, x86_64-pc-windows-gnu, i686-pc-windows-gnu] | |
include: | |
- target: x86_64-pc-windows-gnu | |
archive: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z | |
mingw_dir: mingw64 | |
- target: i686-pc-windows-gnu | |
archive: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z | |
mingw_dir: mingw32 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup toolchain install stable-${{ matrix.target }} | |
rustup default stable-${{ matrix.target }} | |
- name: Check out MinGW toolchain | |
run: | | |
set -x | |
curl -sSf -O "${MINGW_URL}/${{ matrix.archive }}" | |
7z x -y "${{ matrix.archive }}" -o/c/mingw | |
rm "${{ matrix.archive }}" | |
echo "C:\mingw\${{ matrix.mingw_dir }}\bin" >> $GITHUB_PATH | |
shell: bash | |
if: matrix.mingw_dir | |
- run: cargo build | |
- run: cargo build --features nightly | |
- run: cargo build --all-targets | |
- run: cargo test | |
- run: cargo test --no-default-features | |
# NOTE: miri still needs to support more Windows API shims | |
- if: false | |
run: | | |
rustup component add miri | |
cargo clean | |
cargo miri setup | |
cargo miri test | |
- if: failure() | |
run: | | |
Set-PSDebug -Trace 1 | |
Get-ChildItem -Path target\debug\junction-test-*\ | Select-Object FullName, Target | |
Get-ChildItem -Path target\debug\junction-test-*\junction | Select-Object FullName, Target | |
shell: powershell | |
- if: failure() | |
run: | | |
dir /aL C:\ | |
dir /aL C:\Users | |
shell: cmd | |
msrv: | |
runs-on: windows-latest | |
# needs: [build] | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
# add_of_mut! requires for soundness | |
MSRV: 1.51.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup toolchain install ${{ env.MSRV }} | |
rustup default ${{ env.MSRV }} | |
- run: | | |
rustup run stable cargo generate-lockfile | |
rustup run stable cargo fetch | |
- run: | | |
cargo build --all-targets --locked | |
- run: | | |
cargo test | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: cargo fmt -- --check | |
rustdoc: | |
runs-on: windows-latest | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master' | |
needs: [build] | |
steps: | |
- name: Before checking out source and change \n -> \r\n | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup toolchain install nightly | |
rustup default nightly | |
- run: cargo doc --all --no-deps # --document-private-items | |
- run: echo '<meta http-equiv=refresh content=0;url=junction/index.html>' > target/doc/index.html | |
- name: Commit docs to gh-pages branch | |
working-directory: target/doc | |
run: | | |
# Bypassing Jekyll on GitHub Pages | |
touch .nojekyll | |
REV=$(git rev-parse --short HEAD) | |
git init | |
git config user.name "Actions" | |
git config user.email "" | |
git add -A . | |
# git add --renormalize . | |
git commit -qm "Documentation for ${{github.repository}}@${REV}" | |
shell: bash | |
- name: Push gh-pages to GitHub | |
working-directory: target/doc | |
run: | | |
git remote add upstream https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git push -q upstream HEAD:gh-pages --force | |
clippy: | |
runs-on: windows-latest | |
needs: [build] | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup toolchain install nightly -c clippy | |
rustup default nightly | |
- run: cargo clippy --all-targets --all-features -- -Dwarnings | |
# Use static analyzer Rudra <https://github.com/sslab-gatech/Rudra>. | |
# FIXME: Disable for now since it's very costly to run. | |
rudra: | |
if: false | |
runs-on: ubuntu-latest | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
MSRV: nightly-2021-08-20 | |
WIN_TARGET: x86_64-pc-windows-gnu | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: junction | |
- uses: actions/checkout@v3 | |
with: | |
repository: sslab-gatech/Rudra | |
path: Rudra | |
- name: setup | |
shell: bash | |
run: | | |
# Toolchain setup | |
rustup toolchain install ${{ env.MSRV }} -c rustc-dev -c miri | |
rustup default ${{ env.MSRV }} | |
rustup target add ${{ env.WIN_TARGET }} | |
# Environment variable setup, put these in your `.bashrc` | |
export RUDRA_RUST_CHANNEL=${{ env.MSRV }} | |
export RUDRA_RUNNER_HOME="$HOME/rudra-home" | |
./setup_rudra_runner_home.py ${RUDRA_RUNNER_HOME} | |
RUDRA_LIB=$HOME/.rustup/toolchains/${RUDRA_RUST_CHANNEL}-x86_64-unknown-linux-gnu/lib | |
export RUSTFLAGS="-L ${RUDRA_LIB}" | |
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${RUDRA_LIB}" | |
echo "RUDRA_RUNNER_HOME=${RUDRA_RUNNER_HOME}" >> $GITHUB_ENV | |
echo "RUDRA_RUST_CHANNEL=${RUDRA_RUST_CHANNEL}" >> $GITHUB_ENV | |
echo "RUSTFLAGS=${RUSTFLAGS}" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV | |
working-directory: Rudra | |
- name: run | |
run: | | |
./install-release.sh | |
shell: bash | |
working-directory: Rudra | |
- run: | | |
# for single file testing (you need to set library include path, or use `cargo run` instead) | |
# rudra --crate-type lib tests/unsafe_destructor/normal1.rs | |
cargo rudra --target ${{ env.WIN_TARGET }} --all-targets # for crate compilation | |
working-directory: junction |