1name: CI 2 3on: [pull_request, push] 4 5jobs: 6 # Check code formatting. 7 fmt: 8 name: Rustfmt 9 runs-on: ubuntu-latest 10 steps: 11 - name: Checkout sources 12 uses: actions/checkout@v2 13 - name: Install rust 14 uses: actions-rs/toolchain@v1 15 with: 16 toolchain: stable 17 components: rustfmt 18 profile: minimal 19 override: true 20 - name: Run rustfmt 21 uses: actions-rs/cargo@v1 22 with: 23 command: fmt 24 args: --all -- --check 25 26 # Static analyzer. 27 clippy: 28 name: Clippy 29 runs-on: ubuntu-latest 30 steps: 31 - name: Checkout sources 32 uses: actions/checkout@v2 33 - name: Install rust 34 uses: actions-rs/toolchain@v1 35 with: 36 toolchain: stable 37 components: clippy 38 profile: minimal 39 override: true 40 - name: Run clippy 41 uses: actions-rs/clippy-check@v1 42 with: 43 token: ${{ secrets.GITHUB_TOKEN }} 44 args: --all --tests --all-features -- -D warnings 45 46 # Security audit. 47 audit: 48 name: Security audit 49 runs-on: ubuntu-latest 50 steps: 51 - uses: actions/checkout@v2 52 - uses: actions-rs/audit-check@v1 53 with: 54 token: ${{ secrets.GITHUB_TOKEN }} 55 56 # Tests. 57 test: 58 name: ${{ matrix.build }} 59 runs-on: ${{ matrix.os }} 60 strategy: 61 matrix: 62 include: 63 - build: Linux 64 os: ubuntu-latest 65 - build: macOS 66 os: macOS-latest 67 - build: Windows 68 os: windows-latest 69 steps: 70 - name: Checkout sources 71 uses: actions/checkout@v2 72 - name: Install rust 73 uses: actions-rs/toolchain@v1 74 with: 75 toolchain: stable 76 profile: minimal 77 override: true 78 - name: Install java 79 uses: actions/setup-java@v1 80 with: 81 java-version: '1.8.0' 82 - name: Build 83 uses: actions-rs/cargo@v1 84 with: 85 command: build 86 args: --examples --all 87 - name: Test default features 88 uses: actions-rs/cargo@v1 89 with: 90 command: test 91 - name: Shellcheck 92 if: runner.os == 'Linux' 93 run: .github/workflows/shellcheck.sh 94 - name: Test invocation 95 if: runner.os != 'Windows' 96 run: .github/workflows/run_invocation_tests.sh 97 - name: Test invocation 98 if: runner.os == 'Windows' 99 run: .github/workflows/run_windows_invocation_tests.ps1 100