Skip to content

Commit fde75f6

Browse files
committed
ci: Switch most CI to GitHub actions.
1 parent afa50fa commit fde75f6

File tree

11 files changed

+283
-257
lines changed

11 files changed

+283
-257
lines changed

.github/workflows/bindgen.yml

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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: ${{matrix.os}}
69+
strategy:
70+
matrix:
71+
# TODO(#1954): These should be run on mac too, but turns out they're
72+
# broken.
73+
os: [ubuntu-latest]
74+
steps:
75+
- uses: actions/checkout@v2
76+
77+
- name: Install stable
78+
uses: actions-rs/toolchain@v1
79+
with:
80+
profile: minimal
81+
toolchain: stable
82+
override: true
83+
84+
- name: Test expectations
85+
run: cd tests/expectations && cargo test
86+
87+
test:
88+
runs-on: ${{matrix.os}}
89+
strategy:
90+
matrix:
91+
os: [ubuntu-latest]
92+
llvm_version: ["3.9", "4.0", "5.0", "9.0"]
93+
release_build: [0, 1]
94+
no_default_features: [0, 1]
95+
# FIXME: There are no pre-built static libclang libraries, so the
96+
# `static` feature is not testable atm.
97+
feature_runtime: [0, 1]
98+
feature_extra_asserts: [0]
99+
feature_testing_only_docs: [0]
100+
101+
exclude:
102+
# 3.9 and 4.0 are too old to support regular dynamic linking, so this
103+
# is not expected to work.
104+
- os: ubuntu-latest
105+
llvm_version: "3.9"
106+
no_default_features: 1
107+
feature_runtime: 0
108+
109+
- os: ubuntu-latest
110+
llvm_version: "4.0"
111+
no_default_features: 1
112+
feature_runtime: 0
113+
114+
include:
115+
# Test with extra asserts + docs just with latest llvm versions to
116+
# prevent explosion
117+
- os: ubuntu-latest
118+
llvm_version: "9.0"
119+
release_build: 0
120+
no_default_features: 0
121+
feature_extra_asserts: 1
122+
feature_testing_only_docs: 1
123+
124+
# Ensure stuff works on macos too
125+
- os: macos-latest
126+
llvm_version: "9.0"
127+
release_build: 0
128+
no_default_features: 0
129+
feature_extra_asserts: 0
130+
feature_testing_only_docs: 0
131+
steps:
132+
- uses: actions/checkout@v2
133+
134+
- name: Install stable
135+
uses: actions-rs/toolchain@v1
136+
with:
137+
profile: minimal
138+
toolchain: stable
139+
override: true
140+
141+
- name: Run all the tests
142+
env:
143+
GITHUB_ACTIONS_OS: ${{matrix.os}}
144+
LLVM_VERSION: ${{matrix.llvm_version}}
145+
BINDGEN_RELEASE_BUILD: ${{matrix.release_build}}
146+
BINDGEN_FEATURE_RUNTIME: ${{matrix.feature_runtime}}
147+
BINDGEN_FEATURE_EXTRA_ASSERTS: ${{matrix.feature_extra_asserts}}
148+
BINDGEN_FEATURE_TESTING_ONLY_DOCS: ${{matrix.feature_testing_only_docs}}
149+
BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}}
150+
run: ./ci/test.sh

.travis.yml

+1-82
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,15 @@
11
language: rust
2-
32
dist: xenial
4-
53
os:
64
- linux
7-
85
rust:
96
- stable
10-
117
env:
128
global:
139
- CARGO_TARGET_DIR=/tmp/bindgen
14-
matrix:
15-
# Miscellaneous tests.
16-
# Start "misc" job first since it runs longer than any other job.
17-
- LLVM_VERSION="9.0" BINDGEN_JOB="misc"
18-
- LLVM_VERSION="9.0" BINDGEN_JOB="quickchecking"
19-
- LLVM_VERSION="9.0" BINDGEN_JOB="msrv"
20-
21-
# General matrix.
22-
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE=
23-
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
24-
- LLVM_VERSION="3.9" BINDGEN_JOB="integration" BINDGEN_PROFILE=
25-
- LLVM_VERSION="3.9" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
26-
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"
27-
- LLVM_VERSION="3.9" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"
28-
29-
- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
30-
- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
31-
- LLVM_VERSION="4.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
32-
- LLVM_VERSION="4.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
33-
- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"
34-
- LLVM_VERSION="4.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1" BINDGEN_FEATURES="runtime"
35-
36-
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
37-
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
38-
- LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
39-
- LLVM_VERSION="5.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
40-
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1"
41-
- LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1"
42-
43-
# FIXME: There are no pre-built static libclang libraries, so this is not testable at the moment.
44-
# - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"
45-
# - LLVM_VERSION="5.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"
46-
47-
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
48-
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
49-
- LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
50-
- LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
51-
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_NO_DEFAULT_FEATURES="1"
52-
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_NO_DEFAULT_FEATURES="1"
53-
54-
# FIXME: There are no pre-built static libclang libraries, so this is not testable at the moment.
55-
# - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"
56-
# - LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="static" BINDGEN_NO_DEFAULT_FEATURES="1"
57-
58-
# Testing with extra asserts enabled
59-
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
60-
- LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"
61-
62-
63-
# Test the expectations build and pass tests.
64-
- LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
65-
- LLVM_VERSION="9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
66-
67-
matrix:
68-
fast_finish: true
69-
70-
# Include a few jobs for spot-checking different configurations without
71-
# invoking combinatoric explosion of Travis jobs.
72-
include:
73-
- os: osx
74-
env: LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
75-
- os: osx
76-
env: LLVM_VERSION="9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
77-
- os: osx
78-
env: LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
79-
- os: osx
80-
env: LLVM_VERSION="9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
81-
82-
cache:
83-
directories:
84-
- $HOME/.cargo
85-
- $HOME/.llvm-builds
86-
87-
before_install: . ./ci/before_install.sh
88-
8910
script:
90-
- BINDGEN_JOB="$BINDGEN_JOB" BINDGEN_PROFILE="$BINDGEN_PROFILE" BINDGEN_FEATURES="$BINDGEN_FEATURES" BINDGEN_NO_DEFAULT_FEATURES="$BINDGEN_NO_DEFAULT_FEATURES" ./ci/script.sh
91-
11+
- ./ci/test-book.sh
9212
after_success:
9313
- test "$TRAVIS_PULL_REQUEST" == "false" &&
9414
test "$TRAVIS_BRANCH" == "master" &&
95-
test "$BINDGEN_JOB" == "misc" &&
9615
./ci/deploy-book.sh

bindgen-integration/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cc = "1.0"
1414
static = ["bindgen/static"]
1515
runtime = ["bindgen/runtime"]
1616

17+
testing_only_docs = ["bindgen/testing_only_docs"]
1718
testing_only_extra_assertions = ["bindgen/testing_only_extra_assertions"]
1819
testing_only_libclang_9 = ["bindgen/testing_only_libclang_9"]
1920
testing_only_libclang_5 = ["bindgen/testing_only_libclang_5"]

ci/assert-docs.sh

-6
This file was deleted.

ci/assert-no-diff.sh

-8
This file was deleted.

ci/assert-rustfmt.sh

-13
This file was deleted.

ci/assert-warnings.sh

-6
This file was deleted.

ci/before_install.sh

-77
This file was deleted.

0 commit comments

Comments
 (0)