Skip to content

Commit

Permalink
ci: Switch most CI to GitHub actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Dec 26, 2020
1 parent afa50fa commit fde75f6
Show file tree
Hide file tree
Showing 11 changed files with 283 additions and 257 deletions.
150 changes: 150 additions & 0 deletions .github/workflows/bindgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
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

- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

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.40.0
override: true

- name: Build with msrv
run: rm Cargo.lock && cargo +1.40.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]
llvm_version: ["3.9", "4.0", "5.0", "9.0"]
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

# 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 stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run all the tests
env:
GITHUB_ACTIONS_OS: ${{matrix.os}}
LLVM_VERSION: ${{matrix.llvm_version}}
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
83 changes: 1 addition & 82 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,96 +1,15 @@
language: rust

dist: xenial

os:
- linux

rust:
- stable

env:
global:
- CARGO_TARGET_DIR=/tmp/bindgen
matrix:
# Miscellaneous tests.
# Start "misc" job first since it runs longer than any other job.
- LLVM_VERSION="9.0" BINDGEN_JOB="misc"
- LLVM_VERSION="9.0" BINDGEN_JOB="quickchecking"
- LLVM_VERSION="9.0" BINDGEN_JOB="msrv"

# General matrix.
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE=
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
- LLVM_VERSION="3.9" BINDGEN_JOB="integration" BINDGEN_PROFILE=
- LLVM_VERSION="3.9" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"

- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
- LLVM_VERSION="4.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
- LLVM_VERSION="4.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"
- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"

- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
- LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
- LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1"
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1"

# FIXME: There are no pre-built static libclang libraries, so this is not testable at the moment.
# - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"
# - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"

- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
- LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
- LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1"
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1"

# FIXME: There are no pre-built static libclang libraries, so this is not testable at the moment.
# - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"
# - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"

# Testing with extra asserts enabled
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"


# Test the expectations build and pass tests.
- LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
- LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"

matrix:
fast_finish: true

# Include a few jobs for spot-checking different configurations without
# invoking combinatoric explosion of Travis jobs.
include:
- os: osx
env: LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
- os: osx
env: LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
- os: osx
env: LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
- os: osx
env: LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"

cache:
directories:
- $HOME/.cargo
- $HOME/.llvm-builds

before_install: . ./ci/before_install.sh

script:
- BINDGEN_JOB="$BINDGEN_JOB" BINDGEN_PROFILE="$BINDGEN_PROFILE" BINDGEN_FEATURES="$BINDGEN_FEATURES" BINDGEN_NO_DEFAULT_FEATURES="$BINDGEN_NO_DEFAULT_FEATURES" ./ci/script.sh

- ./ci/test-book.sh
after_success:
- test "$TRAVIS_PULL_REQUEST" == "false" &&
test "$TRAVIS_BRANCH" == "master" &&
test "$BINDGEN_JOB" == "misc" &&
./ci/deploy-book.sh
1 change: 1 addition & 0 deletions bindgen-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cc = "1.0"
static = ["bindgen/static"]
runtime = ["bindgen/runtime"]

testing_only_docs = ["bindgen/testing_only_docs"]
testing_only_extra_assertions = ["bindgen/testing_only_extra_assertions"]
testing_only_libclang_9 = ["bindgen/testing_only_libclang_9"]
testing_only_libclang_5 = ["bindgen/testing_only_libclang_5"]
Expand Down
6 changes: 0 additions & 6 deletions ci/assert-docs.sh

This file was deleted.

8 changes: 0 additions & 8 deletions ci/assert-no-diff.sh

This file was deleted.

13 changes: 0 additions & 13 deletions ci/assert-rustfmt.sh

This file was deleted.

6 changes: 0 additions & 6 deletions ci/assert-warnings.sh

This file was deleted.

77 changes: 0 additions & 77 deletions ci/before_install.sh

This file was deleted.

Loading

0 comments on commit fde75f6

Please sign in to comment.