|
| 1 | +name: bindgen |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - master |
| 10 | + |
| 11 | +jobs: |
| 12 | + rustfmt: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + |
| 18 | + - name: Install stable |
| 19 | + uses: actions-rs/toolchain@v1 |
| 20 | + with: |
| 21 | + profile: minimal |
| 22 | + # TODO: Should ideally be stable, but we use some nightly-only |
| 23 | + # features. |
| 24 | + toolchain: nightly |
| 25 | + override: true |
| 26 | + components: rustfmt |
| 27 | + |
| 28 | + - name: Run rustfmt |
| 29 | + uses: actions-rs/cargo@v1 |
| 30 | + with: |
| 31 | + command: fmt |
| 32 | + args: -- --check |
| 33 | + |
| 34 | + msrv: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v2 |
| 38 | + |
| 39 | + - name: Install msrv |
| 40 | + uses: actions-rs/toolchain@v1 |
| 41 | + with: |
| 42 | + profile: minimal |
| 43 | + # MSRV below is documented in README.md, please update that if you |
| 44 | + # change this. |
| 45 | + toolchain: 1.40.0 |
| 46 | + override: true |
| 47 | + |
| 48 | + - name: Build with msrv |
| 49 | + run: rm Cargo.lock && cargo +1.40.0 build --lib |
| 50 | + |
| 51 | + quickchecking: |
| 52 | + runs-on: ubuntu-latest |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v2 |
| 55 | + |
| 56 | + - name: Install stable |
| 57 | + uses: actions-rs/toolchain@v1 |
| 58 | + with: |
| 59 | + profile: minimal |
| 60 | + toolchain: stable |
| 61 | + override: true |
| 62 | + |
| 63 | + # TODO: Actually run quickchecks once `bindgen` is reliable enough. |
| 64 | + - name: Build quickcheck tests |
| 65 | + run: cd tests/quickchecking && cargo test |
| 66 | + |
| 67 | + test-expectations: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v2 |
| 71 | + |
| 72 | + - name: Install stable |
| 73 | + uses: actions-rs/toolchain@v1 |
| 74 | + with: |
| 75 | + profile: minimal |
| 76 | + toolchain: stable |
| 77 | + override: true |
| 78 | + |
| 79 | + - name: Test expectations |
| 80 | + run: cd tests/expectations && cargo test |
| 81 | + |
| 82 | + test: |
| 83 | + runs-on: ${{matrix.os}} |
| 84 | + strategy: |
| 85 | + matrix: |
| 86 | + os: [ubuntu-latest] |
| 87 | + llvm_version: ["3.9", "4.0", "5.0", "9.0"] |
| 88 | + release_build: [0, 1] |
| 89 | + no_default_features: [0, 1] |
| 90 | + # FIXME: There are no pre-built static libclang libraries, so the |
| 91 | + # `static` feature is not testable atm. |
| 92 | + feature_runtime: [0, 1] |
| 93 | + feature_extra_asserts: [0] |
| 94 | + |
| 95 | + include: |
| 96 | + # Test with extra asserts just with latest llvm versions to prevent |
| 97 | + # explosion |
| 98 | + - os: ubuntu-latest |
| 99 | + llvm_version: "9.0" |
| 100 | + release_build: 0 |
| 101 | + no_default_features: 0 |
| 102 | + feature_extra_asserts: 1 |
| 103 | + |
| 104 | + # Ensure stuff works on macos too |
| 105 | + - os: macos-latest |
| 106 | + llvm_version: "9.0" |
| 107 | + release_build: 0 |
| 108 | + no_default_features: 0 |
| 109 | + feature_extra_asserts: 0 |
| 110 | + steps: |
| 111 | + - uses: actions/checkout@v2 |
| 112 | + |
| 113 | + - name: Install stable |
| 114 | + uses: actions-rs/toolchain@v1 |
| 115 | + with: |
| 116 | + profile: minimal |
| 117 | + toolchain: stable |
| 118 | + override: true |
| 119 | + |
| 120 | + - name: Run all the tests |
| 121 | + env: |
| 122 | + GITHUB_ACTIONS_OS: ${{matrix.os}} |
| 123 | + LLVM_VERSION: ${{matrix.llvm_version}} |
| 124 | + BINDGEN_RELEASE_BUILD: ${{matrix.release_build}} |
| 125 | + BINDGEN_FEATURE_RUNTIME: ${{matrix.feature_runtime}} |
| 126 | + BINDGEN_FEATURE_EXTRA_ASSERTS: ${{matrix.feature_extra_asserts}} |
| 127 | + BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}} |
| 128 | + run: ./ci/test.sh |
0 commit comments