name: CI
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta, nightly]
rustflags:
- ''
- '--cfg int_enum_test_no_std'
- '--cfg int_enum_test_repr128'
exclude:
- rust: stable
rustflags: '--cfg int_enum_test_repr128'
- rust: beta
rustflags: '--cfg int_enum_test_repr128'
env:
RUSTFLAGS: ${{ matrix.rustflags }}
steps:
- uses: actions/checkout@master
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- run: cargo test
- run: cargo test --no-default-features
- run: cargo test --features std
- run: cargo test --features serde
- run: cargo test --features convert
- run: cargo test --all-features
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update 1.38.0 --no-self-update && rustup default 1.38.0
shell: bash
- run: cargo build
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- run: cargo fmt -- --check
publish_docs:
name: Publish Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update stable && rustup default stable
- name: Build documentation
run: cargo doc --no-deps --all-features
- name: Publish documentation
run: |
cd target/doc
echo '<meta http-equiv="refresh" content="0;url=int-enum/index.html">' > index.html
git init
git add .
git -c user.name='ci' -c user.email='ci' commit -m init
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'