| name: bindgen |
| |
| on: |
| push: |
| branches: |
| - master |
| pull_request: |
| branches: |
| - master |
| |
| jobs: |
| rustfmt: |
| runs-on: ubuntu-latest |
| |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Install stable |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| # TODO: Should ideally be stable, but we use some nightly-only |
| # features. |
| toolchain: nightly |
| override: true |
| components: rustfmt, clippy |
| |
| - name: Run rustfmt |
| uses: actions-rs/cargo@v1 |
| with: |
| command: fmt |
| args: -- --check |
| |
| - name: Run clippy |
| uses: actions-rs/cargo@v1 |
| with: |
| command: clippy |
| |
| msrv: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Install msrv |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| # MSRV below is documented in README.md, please update that if you |
| # change this. |
| toolchain: 1.46.0 |
| override: true |
| |
| - name: Build with msrv |
| run: rm Cargo.lock && cargo +1.46.0 build --lib |
| |
| quickchecking: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Install stable |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| toolchain: stable |
| override: true |
| |
| # TODO: Actually run quickchecks once `bindgen` is reliable enough. |
| - name: Build quickcheck tests |
| run: cd tests/quickchecking && cargo test |
| |
| test-expectations: |
| runs-on: ${{matrix.os}} |
| strategy: |
| matrix: |
| # TODO(#1954): These should be run on mac too, but turns out they're |
| # broken. |
| os: [ubuntu-latest] |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Install stable |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| toolchain: stable |
| override: true |
| |
| - name: Test expectations |
| run: cd tests/expectations && cargo test |
| |
| test: |
| runs-on: ${{matrix.os}} |
| strategy: |
| matrix: |
| os: [ubuntu-latest] |
| target: |
| - debian: null |
| cross: null |
| rust: null |
| llvm_version: ["3.9", "4.0", "5.0", "9.0"] |
| main_tests: [1] |
| release_build: [0, 1] |
| no_default_features: [0, 1] |
| # FIXME: There are no pre-built static libclang libraries, so the |
| # `static` feature is not testable atm. |
| feature_runtime: [0, 1] |
| feature_extra_asserts: [0] |
| feature_testing_only_docs: [0] |
| |
| exclude: |
| # 3.9 and 4.0 are too old to support regular dynamic linking, so this |
| # is not expected to work. |
| - os: ubuntu-latest |
| llvm_version: "3.9" |
| no_default_features: 1 |
| feature_runtime: 0 |
| |
| - os: ubuntu-latest |
| llvm_version: "4.0" |
| no_default_features: 1 |
| feature_runtime: 0 |
| |
| include: |
| # Test with extra asserts + docs just with latest llvm versions to |
| # prevent explosion |
| - os: ubuntu-latest |
| llvm_version: "9.0" |
| release_build: 0 |
| no_default_features: 0 |
| feature_extra_asserts: 1 |
| feature_testing_only_docs: 1 |
| |
| # FIXME: Seems installing multiarch packages fails: |
| # |
| # https://github.com/rust-lang/rust-bindgen/pull/2037/checks?check_run_id=2441799333 |
| # |
| # - os: ubuntu-latest |
| # target: |
| # debian: arm64 |
| # cross: aarch64-linux-gnu |
| # rust: aarch64-unknown-linux-gnu |
| # llvm_version: "9.0" |
| # main_tests: 0 |
| # release_build: 0 |
| # feature_extra_asserts: 0 |
| # feature_testing_only_docs: 0 |
| |
| # Ensure stuff works on macos too |
| - os: macos-latest |
| llvm_version: "9.0" |
| release_build: 0 |
| no_default_features: 0 |
| feature_extra_asserts: 0 |
| feature_testing_only_docs: 0 |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Install multiarch packages |
| if: matrix.target.debian |
| run: | |
| sudo apt-get install binfmt-support qemu-user-static gcc-${{matrix.target.cross}} g++-${{matrix.target.cross}} |
| source /etc/lsb-release |
| sudo tee /etc/apt/sources.list <<EOF >/dev/null |
| deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main |
| deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main |
| deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-backports main |
| deb [arch=${{matrix.target.debian}}] http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-security main |
| EOF |
| sudo dpkg --add-architecture ${{matrix.target.debian}} |
| sudo apt-get update |
| sudo apt-get install libc6:${{matrix.target.debian}} libstdc++6:${{matrix.target.debian}} |
| |
| - name: Install stable |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| toolchain: stable |
| target: ${{matrix.target.rust}} |
| override: true |
| |
| - name: Run all the tests |
| env: |
| GITHUB_ACTIONS_OS: ${{matrix.os}} |
| RUST_CROSS_COMPILER: ${{matrix.target.cross}} |
| RUST_TARGET: ${{matrix.target.rust}} |
| LLVM_VERSION: ${{matrix.llvm_version}} |
| BINDGEN_MAIN_TESTS: ${{matrix.main_tests}} |
| BINDGEN_RELEASE_BUILD: ${{matrix.release_build}} |
| BINDGEN_FEATURE_RUNTIME: ${{matrix.feature_runtime}} |
| BINDGEN_FEATURE_EXTRA_ASSERTS: ${{matrix.feature_extra_asserts}} |
| BINDGEN_FEATURE_TESTING_ONLY_DOCS: ${{matrix.feature_testing_only_docs}} |
| BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}} |
| run: ./ci/test.sh |
| |
| test-book: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v2 |
| |
| - name: Install stable |
| uses: actions-rs/toolchain@v1 |
| with: |
| profile: minimal |
| toolchain: stable |
| override: true |
| |
| # NOTE(emilio): Change deploy-book as well if you change this. |
| - name: Test book |
| run: | |
| curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.5/mdbook-v0.4.5-x86_64-unknown-linux-gnu.tar.gz | tar xz |
| ./mdbook build book |
| ./mdbook test book |