Skip to content

Commit 68e2f0e

Browse files
committed
Migrate CI to github actions
1 parent 417efaa commit 68e2f0e

File tree

8 files changed

+151
-171
lines changed

8 files changed

+151
-171
lines changed

.github/workflows/main.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
name: Test
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
build: [x86_64, i686, x86_64-musl, mingw, system-curl, openssl-110, x86_64-beta, x86_64-nightly, macos, win64, win32, win2016]
12+
include:
13+
- build: x86_64
14+
os: ubuntu-latest
15+
rust: stable
16+
docker: linux64
17+
target: x86_64-unknown-linux-gnu
18+
- build: x86_64-beta
19+
os: ubuntu-latest
20+
rust: beta
21+
docker: linux64
22+
target: x86_64-unknown-linux-gnu
23+
- build: x86_64-nightly
24+
os: ubuntu-latest
25+
rust: nightly
26+
docker: linux64
27+
target: x86_64-unknown-linux-gnu
28+
- build: i686
29+
os: ubuntu-latest
30+
rust: stable
31+
docker: linux32
32+
target: i686-unknown-linux-gnu
33+
- build: x86_64-musl
34+
os: ubuntu-latest
35+
rust: stable
36+
docker: musl
37+
target: x86_64-unknown-linux-musl
38+
- build: mingw
39+
os: ubuntu-latest
40+
rust: stable
41+
docker: mingw
42+
target: x86_64-pc-windows-gnu
43+
no_run: true
44+
- build: system-curl
45+
os: ubuntu-latest
46+
rust: stable
47+
docker: linux64-curl
48+
target: x86_64-unknown-linux-gnu
49+
- build: openssl-110
50+
os: ubuntu-latest
51+
rust: stable
52+
docker: centos7
53+
target: x86_64-unknown-linux-gnu
54+
- build: macos
55+
os: macos-latest
56+
rust: stable
57+
target: x86_64-apple-darwin
58+
- build: win32
59+
os: windows-latest
60+
rust: stable
61+
target: i686-pc-windows-msvc
62+
- build: win64
63+
os: windows-latest
64+
rust: stable
65+
target: x86_64-pc-windows-msvc
66+
- build: win2016
67+
os: windows-2016
68+
rust: stable
69+
target: x86_64-pc-windows-msvc
70+
steps:
71+
- uses: actions/checkout@master
72+
with:
73+
submodules: true
74+
- name: Install Rust (rustup)
75+
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
76+
if: matrix.os != 'macos-latest'
77+
- name: Install Rust (macos)
78+
run: |
79+
curl https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ matrix.rust }}
80+
echo "##[add-path]$HOME/.cargo/bin"
81+
if: matrix.os == 'macos-latest'
82+
- run: rustup target add ${{ matrix.target }}
83+
- run: TARGET=${{ matrix.target }} ./ci/run.sh
84+
if: matrix.os != 'ubuntu-latest'
85+
name: Run non-docker tests
86+
shell: bash
87+
- run: |
88+
set -e
89+
cargo generate-lockfile
90+
mkdir .cargo target
91+
docker build -t rust -f ci/Dockerfile-${{ matrix.docker }} ci
92+
docker run \
93+
-w /src \
94+
-v `pwd`:/src:ro \
95+
-v `pwd`/target:/src/target \
96+
-v `pwd`/ci/.cargo:/src/.cargo:ro \
97+
-v `rustc --print sysroot`:/usr/local:ro \
98+
-e TARGET=${{ matrix.target }} \
99+
-e NO_RUN=${{ matrix.no_run }} \
100+
-e CARGO_TARGET_DIR=/src/target \
101+
rust \
102+
sh ci/run.sh
103+
if: matrix.os == 'ubuntu-latest'
104+
name: Run docker tests
105+
106+
rustfmt:
107+
name: Rustfmt
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@master
111+
with:
112+
submodules: true
113+
- name: Install Rust
114+
run: rustup update stable && rustup default stable && rustup component add rustfmt
115+
- run: cargo fmt -- --check
116+
117+
publish_docs:
118+
name: Publish Documentation
119+
runs-on: ubuntu-latest
120+
steps:
121+
- uses: actions/checkout@master
122+
with:
123+
submodules: true
124+
- name: Install Rust
125+
run: rustup update stable && rustup default stable
126+
- name: Build documentation
127+
run: cargo doc --no-deps --all-features
128+
- name: Publish documentation
129+
run: |
130+
cd target/doc
131+
git init
132+
git add .
133+
git -c user.name='ci' -c user.email='ci' commit -m init
134+
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
135+
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'

azure-pipelines.yml

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

ci/azure-install-rust.yml

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

ci/azure-steps.yml

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

ci/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
set -ex
44

55
cargo test --target $TARGET --no-run
6+
cargo test --target $TARGET --no-run --features curl-sys/static-curl
67
if [ -z "$NO_RUN" ]; then
78
cargo test --target $TARGET
9+
cargo test --target $TARGET --features curl-sys/static-curl
810
cargo run --manifest-path systest/Cargo.toml --target $TARGET
11+
cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl
912
cargo doc --no-deps --target $TARGET
1013
cargo doc --no-deps -p curl-sys --target $TARGET
1114
fi

src/easy/handle.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,11 @@ impl Easy {
954954
}
955955

956956
/// Same as [`Easy2::ssl_min_max_version`](struct.Easy2.html#method.ssl_min_max_version)
957-
pub fn ssl_min_max_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
957+
pub fn ssl_min_max_version(
958+
&mut self,
959+
min_version: SslVersion,
960+
max_version: SslVersion,
961+
) -> Result<(), Error> {
958962
self.inner.ssl_min_max_version(min_version, max_version)
959963
}
960964

src/easy/handler.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,11 @@ impl<H> Easy2<H> {
19571957
///
19581958
/// By default this option is not set and corresponds to
19591959
/// `CURLOPT_SSLVERSION`.
1960-
pub fn ssl_min_max_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
1960+
pub fn ssl_min_max_version(
1961+
&mut self,
1962+
min_version: SslVersion,
1963+
max_version: SslVersion,
1964+
) -> Result<(), Error> {
19611965
let version = (min_version as c_long) | ((max_version as c_long) << 16);
19621966
self.setopt_long(curl_sys::CURLOPT_SSLVERSION, version)
19631967
}

src/easy/windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ use libc::c_void;
55
#[cfg(target_env = "msvc")]
66
mod win {
77
extern crate winapi;
8+
use self::winapi::ctypes::*;
9+
use self::winapi::um::libloaderapi::*;
10+
use self::winapi::um::wincrypt::*;
811
use schannel::cert_context::ValidUses;
912
use schannel::cert_store::CertStore;
1013
use std::ffi::CString;
1114
use std::mem;
1215
use std::ptr;
13-
use self::winapi::ctypes::*;
14-
use self::winapi::um::libloaderapi::*;
15-
use self::winapi::um::wincrypt::*;
1616

1717
fn lookup(module: &str, symbol: &str) -> Option<*const c_void> {
1818
unsafe {

0 commit comments

Comments
 (0)