ci.yml (2359B)
1 name: CI 2 3 on: 4 pull_request: 5 workflow_call: 6 push: 7 branches: 8 - main 9 10 env: 11 RUST_BACKTRACE: 1 12 SECRET_KEY: "${{ secrets.SECRET_KEY }}" 13 PUBLIC_KEY: "${{ secrets.PUBLIC_KEY }}" 14 15 jobs: 16 ci-pass: 17 name: CI is green 18 runs-on: ubuntu-latest 19 needs: 20 - style 21 - test 22 - docs 23 steps: 24 - run: exit 0 25 26 style: 27 name: Check Style 28 29 runs-on: ubuntu-latest 30 31 steps: 32 - name: Checkout 33 uses: actions/checkout@v1 34 35 - name: Install rust 36 uses: actions-rs/toolchain@v1 37 with: 38 toolchain: stable 39 components: rustfmt 40 profile: minimal 41 override: true 42 43 - name: cargo fmt -- --check 44 uses: actions-rs/cargo@v1 45 with: 46 command: fmt 47 args: -- --check 48 49 - name: temporary workaround - fmt all files under src 50 run: cargo fmt -- --check $(find . -name '*.rs' -print) 51 52 test: 53 name: ${{ matrix.name }} 54 needs: [style] 55 56 runs-on: ${{ matrix.os || 'ubuntu-latest' }} 57 58 strategy: 59 matrix: 60 name: 61 - linux / stable 62 # - macOS / stable 63 64 include: 65 - name: linux / stable 66 # - name: macOS / stable 67 # os: macOS-latest 68 69 steps: 70 - name: Checkout 71 uses: actions/checkout@v1 72 73 - name: Install rust 74 uses: actions-rs/toolchain@v1 75 with: 76 toolchain: ${{ matrix.rust || 'stable' }} 77 target: ${{ matrix.target }} 78 profile: minimal 79 override: true 80 81 - name: Build 82 uses: actions-rs/cargo@v1 83 with: 84 command: build 85 args: ${{ matrix.features }} 86 87 - name: Test 88 uses: actions-rs/cargo@v1 89 with: 90 command: test 91 args: ${{ matrix.features }} ${{ matrix.test-features }} -- --test-threads=1 92 93 docs: 94 name: Docs 95 runs-on: ubuntu-latest 96 97 steps: 98 - name: Checkout repository 99 uses: actions/checkout@v2 100 101 - name: Install Rust 102 uses: actions-rs/toolchain@v1 103 with: 104 toolchain: stable 105 profile: minimal 106 override: true 107 108 - name: Check documentation 109 env: 110 RUSTDOCFLAGS: -D warnings 111 uses: actions-rs/cargo@v1 112 with: 113 command: doc 114 args: --no-deps --document-private-items --all-features