Skip to content

Commit

Permalink
Migrate CI to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Sep 6, 2019
1 parent 417efaa commit 68e2f0e
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 171 deletions.
135 changes: 135 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,135 @@
name: CI
on: [push, pull_request]

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: [x86_64, i686, x86_64-musl, mingw, system-curl, openssl-110, x86_64-beta, x86_64-nightly, macos, win64, win32, win2016]
include:
- build: x86_64
os: ubuntu-latest
rust: stable
docker: linux64
target: x86_64-unknown-linux-gnu
- build: x86_64-beta
os: ubuntu-latest
rust: beta
docker: linux64
target: x86_64-unknown-linux-gnu
- build: x86_64-nightly
os: ubuntu-latest
rust: nightly
docker: linux64
target: x86_64-unknown-linux-gnu
- build: i686
os: ubuntu-latest
rust: stable
docker: linux32
target: i686-unknown-linux-gnu
- build: x86_64-musl
os: ubuntu-latest
rust: stable
docker: musl
target: x86_64-unknown-linux-musl
- build: mingw
os: ubuntu-latest
rust: stable
docker: mingw
target: x86_64-pc-windows-gnu
no_run: true
- build: system-curl
os: ubuntu-latest
rust: stable
docker: linux64-curl
target: x86_64-unknown-linux-gnu
- build: openssl-110
os: ubuntu-latest
rust: stable
docker: centos7
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
- build: win32
os: windows-latest
rust: stable
target: i686-pc-windows-msvc
- build: win64
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
- build: win2016
os: windows-2016
rust: stable
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
if: matrix.os != 'macos-latest'
- name: Install Rust (macos)
run: |
curl https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ matrix.rust }}
echo "##[add-path]$HOME/.cargo/bin"
if: matrix.os == 'macos-latest'
- run: rustup target add ${{ matrix.target }}
- run: TARGET=${{ matrix.target }} ./ci/run.sh
if: matrix.os != 'ubuntu-latest'
name: Run non-docker tests
shell: bash
- run: |
set -e
cargo generate-lockfile
mkdir .cargo target
docker build -t rust -f ci/Dockerfile-${{ matrix.docker }} ci
docker run \
-w /src \
-v `pwd`:/src:ro \
-v `pwd`/target:/src/target \
-v `pwd`/ci/.cargo:/src/.cargo:ro \
-v `rustc --print sysroot`:/usr/local:ro \
-e TARGET=${{ matrix.target }} \
-e NO_RUN=${{ matrix.no_run }} \
-e CARGO_TARGET_DIR=/src/target \
rust \
sh ci/run.sh
if: matrix.os == 'ubuntu-latest'
name: Run docker tests
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check

publish_docs:
name: Publish Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
submodules: true
- name: Install Rust
run: rustup update stable && rustup default stable
- name: Build documentation
run: cargo doc --no-deps --all-features
- name: Publish documentation
run: |
cd target/doc
git init
git add .
git -c user.name='ci' -c user.email='ci' commit -m init
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
101 changes: 0 additions & 101 deletions azure-pipelines.yml

This file was deleted.

34 changes: 0 additions & 34 deletions ci/azure-install-rust.yml

This file was deleted.

31 changes: 0 additions & 31 deletions ci/azure-steps.yml

This file was deleted.

3 changes: 3 additions & 0 deletions ci/run.sh
Expand Up @@ -3,9 +3,12 @@
set -ex

cargo test --target $TARGET --no-run
cargo test --target $TARGET --no-run --features curl-sys/static-curl
if [ -z "$NO_RUN" ]; then
cargo test --target $TARGET
cargo test --target $TARGET --features curl-sys/static-curl
cargo run --manifest-path systest/Cargo.toml --target $TARGET
cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl
cargo doc --no-deps --target $TARGET
cargo doc --no-deps -p curl-sys --target $TARGET
fi
6 changes: 5 additions & 1 deletion src/easy/handle.rs
Expand Up @@ -954,7 +954,11 @@ impl Easy {
}

/// Same as [`Easy2::ssl_min_max_version`](struct.Easy2.html#method.ssl_min_max_version)
pub fn ssl_min_max_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
pub fn ssl_min_max_version(
&mut self,
min_version: SslVersion,
max_version: SslVersion,
) -> Result<(), Error> {
self.inner.ssl_min_max_version(min_version, max_version)
}

Expand Down
6 changes: 5 additions & 1 deletion src/easy/handler.rs
Expand Up @@ -1957,7 +1957,11 @@ impl<H> Easy2<H> {
///
/// By default this option is not set and corresponds to
/// `CURLOPT_SSLVERSION`.
pub fn ssl_min_max_version(&mut self, min_version: SslVersion, max_version: SslVersion) -> Result<(), Error> {
pub fn ssl_min_max_version(
&mut self,
min_version: SslVersion,
max_version: SslVersion,
) -> Result<(), Error> {
let version = (min_version as c_long) | ((max_version as c_long) << 16);
self.setopt_long(curl_sys::CURLOPT_SSLVERSION, version)
}
Expand Down
6 changes: 3 additions & 3 deletions src/easy/windows.rs
Expand Up @@ -5,14 +5,14 @@ use libc::c_void;
#[cfg(target_env = "msvc")]
mod win {
extern crate winapi;
use self::winapi::ctypes::*;
use self::winapi::um::libloaderapi::*;
use self::winapi::um::wincrypt::*;
use schannel::cert_context::ValidUses;
use schannel::cert_store::CertStore;
use std::ffi::CString;
use std::mem;
use std::ptr;
use self::winapi::ctypes::*;
use self::winapi::um::libloaderapi::*;
use self::winapi::um::wincrypt::*;

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

0 comments on commit 68e2f0e

Please sign in to comment.