test new CI

This commit is contained in:
Lokathor 2020-07-25 15:43:31 -06:00
parent 52be254e2c
commit a1ef436bfa
11 changed files with 28 additions and 268 deletions

View File

@ -11,27 +11,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.34.0, stable, beta, nightly]
rust:
# 1.34 doesn't support the alloc feature! (1.36 or later)
- { toolchain: 1.34, extra_args: "" }
# Stable and later support all of our features.
- { toolchain: stable, extra_args: "" }
- { toolchain: stable, extra_args: "--all-features" }
- { toolchain: beta, extra_args: "" }
- { toolchain: beta, extra_args: "--all-features" }
- { toolchain: nightly, extra_args: "" }
- { toolchain: nightly, extra_args: "--all-features" }
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
rust-version: ${{ matrix.rust.toolchain }}
- uses: actions/checkout@v1
- name: Build
run: cargo build
- name: Test
run: cargo test
build_test_with_features:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.34.0, stable, nightly]
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions-rs/cargo@v1
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@v1
- name: Build
run: cargo build --all-features
- name: Test
run: cargo test --all-features
toolchain: ${{ matrix.rust.toolchain }}
command: test
args: ${{ matrix.rust.extra_args }}

View File

@ -1,59 +0,0 @@
language: rust
sudo: false
git:
quiet: true
rust:
- 1.34.0
- stable
- beta
- nightly
os:
- osx
- linux
# Technically works, but super slow, so we use AppVeyor
#- windows
matrix:
fast_finish: true
allow_failures:
- rust: nightly
include:
# If we wanted to flag on --release mode we'd add a line like this
#- { os: linux, rust: 1.38.0, env: FLAGS=--release }
- { os: linux, rust: 1.34.0, env: TARGET=wasm32-unknown-unknown }
#- { os: linux, rust: 1.34.0, env: TARGET=wasm32-wasi }
- { os: linux, rust: 1.34.0, env: TARGET=aarch64-linux-android }
- { os: linux, rust: 1.34.0, env: TARGET=armv7-linux-androideabi }
- { os: linux, rust: 1.34.0, env: TARGET=i686-linux-android }
- { os: linux, rust: 1.34.0, env: TARGET=x86_64-linux-android }
- { os: linux, rust: 1.34.0, env: TARGET=arm-unknown-linux-gnueabihf }
- { os: linux, rust: 1.34.0, env: TARGET=armv7-unknown-linux-gnueabihf }
- { os: linux, rust: 1.34.0, env: TARGET=thumbv7neon-unknown-linux-gnueabihf }
- { os: osx, rust: 1.34.0, env: TARGET=aarch64-apple-ios }
- { os: osx, rust: 1.34.0, env: TARGET=armv7-apple-ios }
- { os: osx, rust: 1.34.0, env: TARGET=armv7s-apple-ios }
- { os: osx, rust: 1.34.0, env: TARGET=i386-apple-ios }
- { os: osx, rust: 1.34.0, env: TARGET=x86_64-apple-ios }
- { os: linux, rust: nightly, env: RUN_MIRI=1 }
script:
- pushd scripts
- ./travis.sh
- popd
# Configured so we cache cargo-web for WASM unit testing, otherwise it takes
# forever (13+ minutes) to compile. See also
# https://levans.fr/rust_travis_cache.html
cache:
directories:
- $TRAVIS_HOME/.cargo/
- $TRAVIS_HOME/.rustup/
before_cache:
- rm -rf "$TRAVIS_HOME/.cargo/registry/src"

View File

@ -1,7 +1,7 @@
[package]
name = "bytemuck"
description = "A crate for mucking around with piles of bytes."
version = "1.3.0"
version = "1.3.1-alpha.0"
authors = ["Lokathor <zefria@gmail.com>"]
repository = "https://github.com/Lokathor/bytemuck"
readme = "README.md"
@ -9,16 +9,12 @@ keywords = ["transmute", "bytes", "casting"]
categories = ["encoding", "no-std"]
edition = "2018"
license = "Zlib OR Apache-2.0 OR MIT"
exclude = ["/scripts/*", "/.travis.yml", "/appveyor.yml", "/bors.toml", "/pedantic.bat"]
[package.metadata.docs.rs]
all-features = true
exclude = ["/pedantic.bat"]
[features]
# Note: Yeah these names are non-standard, we'll fix it in v2 some day maybe
extern_crate_alloc = []
extern_crate_std = ["extern_crate_alloc"]
[badges]
appveyor = { repository = "Lokathor/bytemuck" }
travis-ci = { repository = "Lokathor/bytemuck" }
[package.metadata.docs.rs]
all-features = true

View File

@ -1,45 +0,0 @@
os: Visual Studio 2015
branches:
only:
- staging
- trying
- master
- dev
matrix:
fast_finish: true
environment:
matrix:
# Stable
- channel: 1.34.0
target: i686-pc-windows-msvc
- channel: 1.34.0
target: i686-pc-windows-gnu
- channel: 1.34.0
target: x86_64-pc-windows-msvc
- channel: 1.34.0
target: x86_64-pc-windows-gnu
# Beta and Nightly are checked by TravisCI since builds there run in
# parallel.
install:
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -y --default-toolchain %channel% --default-host %target%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- rustup component add rustfmt
- rustup component add clippy
- rustc -vV
- cargo -vV
# On advice of retep we skip the "build" script phase
build: false
test_script:
- cargo fmt -- --check
- cargo clippy
- cargo test --no-default-features
- cargo test
#- cargo test --all-features

View File

@ -1 +0,0 @@
status = ["continuous-integration/travis-ci/push"]

View File

@ -1,6 +1,6 @@
# `bytemuck` changelog
## 1.3.0
## 1.3.1
* The entire crate is now available under the `Apache-2.0 OR MIT` license as
well as the previous `Zlib` license
@ -19,6 +19,12 @@
isn't aligned has been corrected from being `AlignmentMismatch` (intended for
allocation casting only) to `TargetAlignmentGreaterAndInputNotAligned`.
## 1.3.0
* Had a bug because the CI was messed up! It wasn't soundness related, because
it prevented the crate from building entirely if the `extern_crate_alloc`
feature was used. Still, this is yanked, sorry.
## 1.2.0
* [thomcc](https://github.com/thomcc) added many things:

View File

@ -1,16 +0,0 @@
# Don't generate CPU mismatch warnings when cross-compiling
[target.arm-unknown-linux-gnueabihf]
ar = "arm-linux-gnueabihf-ar"
linker = "arm-linux-gnueabihf-gcc"
rustflags = ["-C","target-cpu=generic"]
[target.armv7-unknown-linux-gnueabihf]
ar = "arm-linux-gnueabihf-ar"
linker = "arm-linux-gnueabihf-gcc"
rustflags = ["-C","target-cpu=generic"]
[target.thumbv7neon-unknown-linux-gnueabihf]
ar = "arm-linux-gnueabihf-ar"
linker = "arm-linux-gnueabihf-gcc"
rustflags = ["-C","target-cpu=generic"]

View File

@ -1,21 +0,0 @@
# Android ar/linker/flags config for when building on linux.
[target.aarch64-linux-android]
ar = "aarch64-linux-android-ar"
linker = "aarch64-linux-android21-clang"
rustflags = ["-C","target-cpu=generic"]
[target.armv7-linux-androideabi]
ar = "armv7a-linux-androideabi-ar"
linker = "armv7a-linux-androideabi21-clang"
rustflags = ["-C","target-cpu=generic"]
[target.i686-linux-android]
ar = "i686-linux-android-ar"
linker = "i686-linux-android21-clang"
rustflags = ["-C","target-cpu=generic"]
[target.x86_64-linux-android]
ar = "x86_64-linux-android-ar"
linker = "x86_64-linux-android21-clang"
rustflags = ["-C","target-cpu=generic"]

View File

@ -1,77 +0,0 @@
#!/bin/bash
set -e
if [[ "$RUN_MIRI" != "" ]]; then
cargo clean
# Install and run the latest version of nightly where miri built successfully.
# Taken from: https://github.com/rust-lang/miri#running-miri-on-ci
MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
echo "Installing latest nightly with Miri: $MIRI_NIGHTLY"
rustup set profile minimal
rustup default "$MIRI_NIGHTLY"
rustup component add miri
cargo miri setup
cargo miri test --verbose
cargo miri test --verbose --no-default-features
cargo miri test --verbose --all-features
else
rustup component add clippy
cargo clippy
if [[ "$TARGET" != "" ]]; then rustup target install $TARGET; fi
if [[ "$TARGET" == "wasm32-"* && "$TARGET" != "wasm32-wasi" ]]; then
cargo-web --version || cargo install cargo-web
cargo web test --no-default-features $FLAGS --target=$TARGET
cargo web test $FLAGS --target=$TARGET
#cargo web test --all-features $FLAGS --target=$TARGET
elif [[ "$TARGET" == *"-linux-android"* ]]; then
export PATH=/usr/local/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
pushd linux-android
cargo build --no-default-features --target=$TARGET $FLAGS
cargo build --target=$TARGET $FLAGS
#cargo build --all-features --target=$TARGET $FLAGS
# Don't test, can't run android emulators successfully on travis currently
popd
elif [[ "$TARGET" == *"-apple-ios" || "$TARGET" == "wasm32-wasi" ]]; then
cargo build --no-default-features --target=$TARGET $FLAGS
cargo build --target=$TARGET $FLAGS
#cargo build --all-features --target=$TARGET $FLAGS
# Don't test
# iOS simulator setup/teardown is complicated
# cargo-web doesn't support wasm32-wasi yet, nor can wasm-pack test specify a target
elif [[ "$TARGET" == *"-unknown-linux-gnueabihf" ]]; then
#sudo apt-get update
#sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
pushd generic-cross
cargo build --no-default-features --target=$TARGET $FLAGS
cargo build --target=$TARGET $FLAGS
#cargo build --all-features --target=$TARGET $FLAGS
# Don't test
popd
elif [[ "$TARGET" != "" ]]; then
pushd generic-cross
cargo test --no-default-features --target=$TARGET $FLAGS
cargo test --target=$TARGET $FLAGS
#cargo test --all-features --target=$TARGET $FLAGS
popd
else
# Push nothing, target host CPU architecture
cargo test --no-default-features $FLAGS
cargo test $FLAGS
fi
fi

View File

@ -1,21 +0,0 @@
# Android ar/linker/flags config for when building on windows.
[target.aarch64-linux-android]
ar = "aarch64-linux-android-ar.cmd"
linker = "aarch64-linux-android21-clang.cmd"
rustflags = ["-C","target-cpu=generic"]
[target.armv7-linux-androideabi]
ar = "armv7a-linux-androideabi-ar.cmd"
linker = "armv7a-linux-androideabi21-clang.cmd"
rustflags = ["-C","target-cpu=generic"]
[target.i686-linux-android]
ar = "i686-linux-android-ar.cmd"
linker = "i686-linux-android21-clang.cmd"
rustflags = ["-C","target-cpu=generic"]
[target.x86_64-linux-android]
ar = "x86_64-linux-android-ar.cmd"
linker = "x86_64-linux-android21-clang.cmd"
rustflags = ["-C","target-cpu=generic"]

View File

@ -1,3 +1,5 @@
#![cfg(feature = "extern_crate_alloc")]
//! Stuff to boost things in the `alloc` crate.
//!
//! * You must enable the `extern_crate_alloc` feature of `bytemuck` or you will