|
| 1 | +name: Rust |
| 2 | + |
| 3 | +on: [ push, pull_request ] |
| 4 | + |
| 5 | +env: |
| 6 | + CARGO_TERM_COLOR: always |
| 7 | + |
| 8 | +jobs: |
| 9 | + test-linux: |
| 10 | + name: Test (Linux) |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: checkout source |
| 14 | + uses: actions/checkout@v3 |
| 15 | + - name: set up cargo cache |
| 16 | + uses: actions/cache@v3 |
| 17 | + continue-on-error: false |
| 18 | + with: |
| 19 | + path: | |
| 20 | + .cache/cargo/registry/index/ |
| 21 | + .cache/cargo/registry/cache/ |
| 22 | + .cache/cargo/git/db/ |
| 23 | + key: ${{ runner.os }}-cargo |
| 24 | + restore-keys: ${{ runner.os }}-cargo |
| 25 | + - name: set up nginx source binary cache |
| 26 | + uses: actions/cache@v3 |
| 27 | + continue-on-error: false |
| 28 | + with: |
| 29 | + path: | |
| 30 | + .cache/.gnupg |
| 31 | + .cache/*.tar.gz |
| 32 | + .cache/*.tar.asc |
| 33 | + .cache/*.tar.sig |
| 34 | + key: nginx-${{ hashFiles('**/nginx-sys/build.rs') }} |
| 35 | + restore-keys: nginx- |
| 36 | + - name: run tests in container |
| 37 | + run: make container-test |
| 38 | + |
| 39 | + test-macos: |
| 40 | + name: Test (MacOS) |
| 41 | + runs-on: macos-latest |
| 42 | + steps: |
| 43 | + - name: install GNU make 4 |
| 44 | + run: brew install make openssl |
| 45 | + - uses: actions/checkout@v3 |
| 46 | + - uses: actions-rs/toolchain@v1 |
| 47 | + with: |
| 48 | + profile: minimal |
| 49 | + toolchain: stable |
| 50 | + override: true |
| 51 | + - name: set up cargo cache |
| 52 | + uses: actions/cache@v3 |
| 53 | + continue-on-error: false |
| 54 | + with: |
| 55 | + path: | |
| 56 | + ~/.cargo/registry/index/ |
| 57 | + ~/.cargo/registry/cache/ |
| 58 | + ~/.cargo/git/db/ |
| 59 | + key: ${{ runner.os }}-cargo |
| 60 | + restore-keys: ${{ runner.os }}-cargo |
| 61 | + - name: set up nginx source binary cache |
| 62 | + uses: actions/cache@v3 |
| 63 | + continue-on-error: false |
| 64 | + with: |
| 65 | + path: | |
| 66 | + .cache/.gnupg |
| 67 | + .cache/*.tar.gz |
| 68 | + .cache/*.tar.asc |
| 69 | + .cache/*.tar.sig |
| 70 | + key: nginx-${{ hashFiles('**/nginx-sys/build.rs') }} |
| 71 | + restore-keys: nginx- |
| 72 | + - name: run tests |
| 73 | + uses: actions-rs/cargo@v1 |
| 74 | + with: |
| 75 | + command: test |
| 76 | + args: --verbose |
| 77 | + |
| 78 | + fmt: |
| 79 | + name: Rustfmt |
| 80 | + runs-on: ubuntu-latest |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v3 |
| 83 | + - uses: actions-rs/toolchain@v1 |
| 84 | + with: |
| 85 | + profile: minimal |
| 86 | + toolchain: stable |
| 87 | + override: true |
| 88 | + - run: rustup component add rustfmt |
| 89 | + - uses: actions-rs/cargo@v1 |
| 90 | + with: |
| 91 | + command: fmt |
| 92 | + args: --all -- --check |
| 93 | + |
| 94 | +# clippy: |
| 95 | +# name: Clippy |
| 96 | +# runs-on: ubuntu-latest |
| 97 | +# steps: |
| 98 | +# - uses: actions/checkout@v3 |
| 99 | +# - uses: actions-rs/toolchain@v1 |
| 100 | +# with: |
| 101 | +# profile: minimal |
| 102 | +# toolchain: stable |
| 103 | +# override: true |
| 104 | +# - run: rustup component add clippy |
| 105 | +# - uses: actions-rs/cargo@v1 |
| 106 | +# with: |
| 107 | +# command: clippy |
| 108 | +# args: -- -D warnings |
| 109 | + |
| 110 | +# docs: |
| 111 | +# name: Docs |
| 112 | +# runs-on: ubuntu-latest |
| 113 | +# steps: |
| 114 | +# - name: Checkout repository |
| 115 | +# uses: actions/checkout@v3 |
| 116 | +# - name: Install Rust |
| 117 | +# uses: actions-rs/toolchain@v1 |
| 118 | +# with: |
| 119 | +# toolchain: stable |
| 120 | +# profile: minimal |
| 121 | +# override: true |
| 122 | +# - name: Check documentation |
| 123 | +# env: |
| 124 | +# RUSTDOCFLAGS: -D warnings |
| 125 | +# uses: actions-rs/cargo@v1 |
| 126 | +# with: |
| 127 | +# command: doc |
| 128 | +# args: --no-deps --document-private-items |
0 commit comments