1name: CI 2on: [push, pull_request] 3 4jobs: 5 test: 6 name: Test 7 runs-on: ubuntu-latest 8 strategy: 9 matrix: 10 rust: [stable, beta, nightly] 11 steps: 12 - uses: actions/checkout@v2 13 - name: Install Rust 14 run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} 15 - run: cargo build --all 16 - run: cargo test --all 17 - run: cargo build --features std 18 19 fuzz_targets: 20 name: Fuzz Targets 21 runs-on: ubuntu-latest 22 steps: 23 - uses: actions/checkout@v2 24 # Note that building with fuzzers requires nightly since it uses unstable 25 # flags to rustc. 26 - run: rustup update nightly && rustup default nightly 27 - run: cargo install cargo-fuzz --vers "^0.11" 28 - run: cargo fuzz build --dev 29 30 rustfmt: 31 name: Rustfmt 32 runs-on: ubuntu-latest 33 steps: 34 - uses: actions/checkout@v2 35 - name: Install Rust 36 run: rustup update stable && rustup default stable && rustup component add rustfmt 37 - run: cargo fmt -- --check 38 39 publish_docs: 40 name: Publish Documentation 41 runs-on: ubuntu-latest 42 steps: 43 - uses: actions/checkout@v2 44 - name: Install Rust 45 run: rustup update stable && rustup default stable 46 - name: Build documentation 47 run: cargo doc --no-deps 48 - name: Publish documentation 49 run: | 50 cd target/doc 51 git init 52 git add . 53 git -c user.name='ci' -c user.email='ci' commit -m init 54 git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages 55 if: github.event_name == 'push' && github.event.ref == 'refs/heads/main' 56