Setup Github workflow and actions

This commit is contained in:
Benjamin Fry 2019-12-11 23:12:49 -08:00
parent 7a285ca5ad
commit 95da2e219e
4 changed files with 74 additions and 229 deletions

View File

@ -1,69 +0,0 @@
clone_depth: 1
environment:
matrix:
- DEFAULT_SUITE: 1
TARGET: x86_64-pc-windows-msvc
BITS: 64
OPENSSL_VERSION: 1_1_0L
OPENSSL_DIR: C:\OpenSSL
- ALL_FEATURES_SUITE: 1
TARGET: x86_64-pc-windows-msvc
BITS: 64
OPENSSL_VERSION: 1_1_0L
OPENSSL_DIR: C:\OpenSSL
# - NO_DEFAULT_FEATURES_SUITE: 1
# TARGET: x86_64-pc-windows-msvc
# BITS: 64
# OPENSSL_VERSION: 1_1_0i
# OPENSSL_DIR: C:\OpenSSL
# - DNSSEC_OPENSSL_SUITE: 1
# TARGET: x86_64-pc-windows-msvc
# BITS: 64
# OPENSSL_VERSION: 1_1_0i
# OPENSSL_DIR: C:\OpenSSL
# - DNSSEC_RING_SUITE: 1
# TARGET: x86_64-pc-windows-msvc
# BITS: 64
# OPENSSL_VERSION: 1_1_0i
# OPENSSL_DIR: C:\OpenSSL
# - DNS_OVER_TLS_SUITE: 1
# TARGET: x86_64-pc-windows-msvc
# BITS: 64
# OPENSSL_VERSION: 1_1_0i
# OPENSSL_DIR: C:\OpenSSL
# FIXME: i686 builds are regularly having issues, disabling to reduce noise
# Just checking the basics on i686/32bit
# - TARGET: i686-pc-windows-msvc
# ALL_FEATURES_SUITE: 1
# BITS: 32
# OPENSSL_VERSION: 1_1_0j
# OPENSSL_DIR: C:\OpenSSL
init:
- ps: Disable-NetFirewallRule -DisplayName 'Core Networking - Group Policy (LSASS-Out)'
install:
# Install OpenSSL
- ps: Start-FileDownload "http://slproweb.com/download/Win${env:BITS}OpenSSL-${env:OPENSSL_VERSION}.exe"
- Win%BITS%OpenSSL-%OPENSSL_VERSION%.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL"
- ps: Start-FileDownload "https://curl.haxx.se/ca/cacert.pem" -FileName "C:\OpenSSL\cacert.pem"
# Install Rust
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
- rustup-init.exe -y --default-host %TARGET% --default-toolchain stable
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- rustc -V
- cargo -V
build: false
# All grouped by feature to reduce recompilation of the libraries
test_script:
- scripts\test_windows.bat

21
.github/workflow/cargo-make.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: rust-linux
on:
push:
branches:
- cargo-make-automation
pull_request:
branches:
- cargo-make-automation
jobs:
cargo-make:
name: install cargo-make
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: download and install cargo-make
run: scripts/install-cargo-make.sh

View File

@ -1,160 +0,0 @@
sudo: required
dist: trusty
language: rust
rust: stable
matrix:
include:
# parallel builds for tests
- env: NAME=all_features
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=default_features
RUST_BACKTRACE=full
script:
- scripts/test_default_features.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=dns_over_native_tls
RUST_BACKTRACE=full
script:
- scripts/test_dns_over_native_tls.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=dns_over_openssl
RUST_BACKTRACE=full
script:
- scripts/test_dns_over_openssl.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=dns_over_rustls
RUST_BACKTRACE=full
script:
- scripts/test_dns_over_rustls.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=dnssec_openssl
RUST_BACKTRACE=full
script:
- scripts/test_dnssec_openssl.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=dnssec_ring
RUST_BACKTRACE=full
script:
- scripts/test_dnssec_ring.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=mdns
RUST_BACKTRACE=full
script:
- scripts/test_mdns.sh
after_success:
- scripts/run_kcov.sh
# parallel builds for tests
- env: NAME=no_default_features
RUST_BACKTRACE=full
script:
- scripts/test_no_default_features.sh
after_success:
- scripts/run_kcov.sh
# min rust version
- rust: 1.39.0
env: NAME=min-version
RUST_BACKTRACE=full
script:
- scripts/test_default_features.sh
# beta
- rust: beta
env: NAME=beta
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
# macos
- os: osx
env: NAME=macOS
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
# nightly
- rust: nightly
env: NAME=nightly
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
# clippy
- env: NAME=clippy
RUST_BACKTRACE=full
script:
- scripts/run_clippy.sh
- env: NAME=rustfmt
RUST_BACKTRACE=full
CARGO_BUILD_PIPELINING=true
before_install:
- rustup component add rustfmt
script:
- cargo fmt --version
- cargo fmt --all -- --check
# benchmark tests; built but not run in Travis to avoid inconsistent timing results
- rust: nightly
env: NAME=bench
script:
- scripts/build_benches.sh
# compatiblity tests
- env: NAME=compatiblity
TDNS_BIND_PATH="../../bind-9.11.7/bin/named/named"
RUST_BACKTRACE=full
before_install:
- sudo apt-get install -y python-ply
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/install_openssl_deb.sh; fi
- scripts/install_bind.sh
script:
- cargo test --manifest-path tests/compatibility-tests/Cargo.toml --no-default-features --features=bind
after_success:
- scripts/run_kcov.sh
- env: NAME=package-audit
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/install_openssl_deb.sh; fi
- cargo install cargo-audit
- cargo check
script:
- cargo audit --deny-warnings
allow_failures:
- rust: nightly
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/install_openssl_deb.sh; fi
## All scripts are run above...
script:
- fail
#after_success: scripts/run_kcov.sh

53
scripts/install-cargo-make.sh Executable file
View File

@ -0,0 +1,53 @@
#!/bin/sh
set -e
## This must run after OpenSSL installation
CARGO_MAKE_VER=0.24.1
# if it's already installed, skip
#if cargo make --version ; then exit 0 ; fi
if ver ; then OS="windows" ;
elif [[ "$(uname)" == "Darwin" ]] ; then OS="darwin" ;
elif [[ "$(uname)" == "Linux" ]] ; then OS="linux" ;
else OS=unknown ;
fi
case $OS in
"windows")
CARGO_MAKE_URL="https://github.com/sagiegurari/cargo-make/releases/download/${CARGO_MAKE_VER:?}/cargo-make-v${CARGO_MAKE_VER:?}-pc-windows-msvc.zip"
echo "----> downloading ${CARGO_MAKE_URL}"
wget -O cargo-make.zip ${CARGO_MAKE_URL:?}
unzip cargo-make.zip
cp -n cargo-make-v${CARGO_MAKE_VER:?}-pc-windows-msvc/cargo-make ${HOME}/.cargo/bin/cargo-make
;;
"darwin")
CARGO_MAKE_URL="https://github.com/sagiegurari/cargo-make/releases/download/${CARGO_MAKE_VER:?}/cargo-make-v${CARGO_MAKE_VER:?}-x86_64-apple-darwin.zip"
echo "----> downloading ${CARGO_MAKE_URL}"
wget -O cargo-make.zip ${CARGO_MAKE_URL:?}
unzip cargo-make.zip
cp -n cargo-make-v${CARGO_MAKE_VER:?}-x86_64-apple-darwin/cargo-make ${HOME}/.cargo/bin/cargo-make
;;
"linux")
CARGO_MAKE_URL="https://github.com/sagiegurari/cargo-make/releases/download/${CARGO_MAKE_VER:?}/cargo-make-v${CARGO_MAKE_VER:?}-x86_64-unknown-linux-musl.zip"
echo "----> downloading ${CARGO_MAKE_URL}"
wget -O cargo-make.zip ${CARGO_MAKE_URL:?}
unzip cargo-make.zip
cp -n cargo-make-v${CARGO_MAKE_VER:?}-x86_64-unknown-linux-musl ${HOME}/.cargo/bin/cargo-make
;;
*)
# TOO BAD, must compile
echo "----> cargo install cargo-make"
cargo install -f cargo-make
;;
esac
echo "----> testing cargo-make"
cargo make --version