Skip to content

Commit 64fe7e1

Browse files
authored
Migrate CI to GitHub Actions (#392)
1 parent e9877e7 commit 64fe7e1

13 files changed

+210
-299
lines changed

.github/workflows/ci.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
env:
12+
RUSTFLAGS: -Dwarnings
13+
RUST_BACKTRACE: 1
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
jobs:
20+
# Check formatting
21+
rustfmt:
22+
name: rustfmt
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Install Rust
27+
run: rustup update stable && rustup default stable
28+
- name: Check formatting
29+
run: cargo fmt --all -- --check
30+
31+
# TODO
32+
# # Apply clippy lints
33+
# clippy:
34+
# name: clippy
35+
# runs-on: ubuntu-latest
36+
# steps:
37+
# - uses: actions/checkout@v2
38+
# - name: Apply clippy lints
39+
# run: cargo clippy --all-features
40+
41+
# This represents the minimum Rust version supported by
42+
# Bytes. Updating this should be done in a dedicated PR.
43+
#
44+
# Tests are not run as tests may require newer versions of
45+
# rust.
46+
minrust:
47+
name: minrust
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Install Rust
52+
run: rustup update 1.39.0 && rustup default 1.39.0
53+
- name: Check
54+
run: . ci/test-stable.sh check
55+
56+
# Stable
57+
stable:
58+
name: stable
59+
strategy:
60+
matrix:
61+
os:
62+
- ubuntu-latest
63+
- macos-latest
64+
- windows-latest
65+
runs-on: ${{ matrix.os }}
66+
steps:
67+
- uses: actions/checkout@v2
68+
- name: Install Rust
69+
run: rustup update stable && rustup default stable
70+
- name: Test
71+
run: . ci/test-stable.sh test
72+
73+
# Nightly
74+
nightly:
75+
name: nightly
76+
env:
77+
# Pin nightly to avoid being impacted by breakage
78+
RUST_VERSION: nightly-2019-09-25
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v2
82+
- name: Install Rust
83+
run: rustup update $RUST_VERSION && rustup default $RUST_VERSION
84+
- name: Test
85+
run: . ci/test-stable.sh test
86+
87+
# Run tests on some extra platforms
88+
cross:
89+
name: cross
90+
strategy:
91+
matrix:
92+
target:
93+
- i686-unknown-linux-gnu
94+
- armv7-unknown-linux-gnueabihf
95+
- powerpc-unknown-linux-gnu
96+
- powerpc64-unknown-linux-gnu
97+
- wasm32-unknown-unknown
98+
runs-on: ubuntu-16.04
99+
steps:
100+
- uses: actions/checkout@v2
101+
- name: Install Rust
102+
run: rustup update stable && rustup default stable
103+
- name: cross build --target ${{ matrix.target }}
104+
run: |
105+
cargo install cross
106+
cross build --target ${{ matrix.target }}
107+
if: matrix.target != 'wasm32-unknown-unknown'
108+
# WASM support
109+
- name: cargo build --target ${{ matrix.target }}
110+
run: |
111+
rustup target add ${{ matrix.target }}
112+
cargo build --target ${{ matrix.target }}
113+
if: matrix.target == 'wasm32-unknown-unknown'
114+
115+
# Sanitizers
116+
tsan:
117+
name: tsan
118+
runs-on: ubuntu-latest
119+
steps:
120+
- uses: actions/checkout@v2
121+
- name: Install Rust
122+
run: rustup update nightly && rustup default nightly
123+
- name: TSAN / MSAN
124+
run: . ci/tsan.sh
125+
126+
# Loom
127+
loom:
128+
name: loom
129+
env:
130+
# Pin nightly to avoid being impacted by breakage
131+
RUST_VERSION: nightly-2020-05-19
132+
runs-on: ubuntu-latest
133+
steps:
134+
- uses: actions/checkout@v2
135+
- name: Install Rust
136+
run: rustup update $RUST_VERSION && rustup default $RUST_VERSION
137+
- name: Loom tests
138+
run: RUSTFLAGS="--cfg loom -Dwarnings" cargo test --lib
139+
140+
publish_docs:
141+
name: Publish Documentation
142+
needs:
143+
- rustfmt
144+
# - clippy
145+
- stable
146+
- nightly
147+
- minrust
148+
- cross
149+
runs-on: ubuntu-latest
150+
steps:
151+
- uses: actions/checkout@v2
152+
- name: Install Rust
153+
run: rustup update stable && rustup default stable
154+
- name: Build documentation
155+
run: cargo doc --no-deps --all-features
156+
- name: Publish documentation
157+
run: |
158+
cd target/doc
159+
git init
160+
git add .
161+
git -c user.name='ci' -c user.email='ci' commit -m 'Deploy Bytes API documentation'
162+
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
163+
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' && github.repository == 'tokio-rs/bytes'

Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ default = ["std"]
2525
std = []
2626

2727
[dependencies]
28-
serde = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
28+
serde = { version = "1.0.60", optional = true, default-features = false, features = ["alloc"] }
2929

3030
[dev-dependencies]
3131
serde_test = "1.0"
3232

33-
# loom is currently not compiling on windows.
34-
# See: https://github.com/Xudong-Huang/generator-rs/issues/19
35-
[target.'cfg(not(windows))'.dev-dependencies]
33+
[target.'cfg(loom)'.dependencies]
3634
loom = "0.3"

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
A utility library for working with bytes.
44

55
[![Crates.io][crates-badge]][crates-url]
6-
[![Build Status][azure-badge]][azure-url]
6+
[![Build Status][ci-badge]][ci-url]
77

88
[crates-badge]: https://img.shields.io/crates/v/bytes.svg
99
[crates-url]: https://crates.io/crates/bytes
10-
[azure-badge]: https://dev.azure.com/tokio-rs/bytes/_apis/build/status/tokio-rs.bytes?branchName=master
11-
[azure-url]: https://dev.azure.com/tokio-rs/bytes/_build/latest?definitionId=3&branchName=master
10+
[ci-badge]: https://github.com/tokio-rs/bytes/workflows/CI/badge.svg
11+
[ci-url]: https://github.com/tokio-rs/bytes/actions
1212

1313
[Documentation](https://docs.rs/bytes)
1414

@@ -45,4 +45,3 @@ This project is licensed under the [MIT license](LICENSE).
4545
Unless you explicitly state otherwise, any contribution intentionally submitted
4646
for inclusion in `bytes` by you, shall be licensed as MIT, without any additional
4747
terms or conditions.
48-

azure-pipelines.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

ci/azure-cross-compile.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

ci/azure-deploy-docs.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

ci/azure-install-rust.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)