Skip to content

Commit 54c2d8d

Browse files
authored
Merge pull request #528 from berkowski/master
Switch to trust-based CI
2 parents 4ab234c + ad82307 commit 54c2d8d

13 files changed

+219
-381
lines changed

.travis.yml

Lines changed: 97 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,106 @@
1-
#
2-
# Operating Environment
3-
#
4-
language: rust
5-
sudo: false
1+
# Based on the "trust" template v0.1.1
2+
# https://github.com/japaric/trust/tree/v0.1.1
3+
64
dist: trusty
7-
services:
8-
- docker
9-
addons:
10-
apt:
11-
packages:
12-
- gcc-multilib
13-
- libcurl4-openssl-dev
14-
- libelf-dev
15-
- libdw-dev
16-
- binutils-dev
17-
18-
rust:
19-
- 1.7.0 # Oldest supported version
20-
- stable
21-
- beta
22-
- nightly
23-
24-
#
25-
# Environment Variables and Build Matrix
26-
#
5+
language: rust
6+
services: docker
7+
sudo: required
8+
9+
# This is the Rust channel that build jobs will use by default but can be
10+
# overridden on a case by case basis down below
11+
rust: stable
12+
2713
env:
2814
global:
29-
- PATH=$HOME/.local/bin:$PATH
30-
- TRAVIS_CARGO_NIGHTLY_FEATURE=""
31-
matrix:
32-
- ARCH=x86_64
33-
- ARCH=i686
15+
- CRATE_NAME=nix
3416

35-
os: # OSX included in build matrix explicitly
36-
- linux
17+
# default job
18+
- TARGET=x86_64-unknown-linux-gnu
3719

38-
# Failures on nightly shouldn't fail the overall build.
3920
matrix:
40-
fast_finish: true
21+
# These are all the build jobs. Adjust as necessary. Comment out what you
22+
# don't need
4123
include:
42-
# 32-bit and 64-bit OSX builds on oldest/stable
43-
- os: osx
44-
env: ARCH=x86_64
45-
rust: stable
46-
- os: osx
47-
env: ARCH=i686
48-
rust: stable
49-
# Docker builds for other targets
50-
- os: linux
51-
env: TARGET=aarch64-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:arm
52-
rust: 1.7.0
53-
sudo: true
54-
- os: linux
55-
env: TARGET=arm-unknown-linux-gnueabihf DOCKER_IMAGE=posborne/rust-cross:arm
56-
rust: 1.7.0
57-
sudo: true
58-
- os: linux
59-
env: TARGET=mips-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
60-
rust: 1.7.0
61-
sudo: true
62-
- os: linux
63-
env: TARGET=mipsel-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
64-
rust: 1.7.0
65-
sudo: true
66-
- os: linux
67-
env: TARGET=arm-linux-androideabi DOCKER_IMAGE=posborne/rust-cross:android
68-
rust: 1.7.0
69-
sudo: true
70-
allow_failures:
71-
- rust: nightly
72-
# We need to upgrade the lowest supported version. However, the build
73-
# infrastructure for arm/mips/android is not ready yet.
74-
- rust: 1.7.0
75-
- env: TARGET=mips-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
76-
- env: TARGET=mipsel-unknown-linux-gnu DOCKER_IMAGE=posborne/rust-cross:mips
77-
- env: TARGET=arm-linux-androideabi DOCKER_IMAGE=posborne/rust-cross:android
78-
79-
80-
#
81-
# Build/Test/Deploy Steps
82-
#
83-
before_script:
84-
- pip install 'travis-cargo<0.2' --user
24+
# Linux
25+
- env: TARGET=i686-unknown-linux-gnu
26+
- env: TARGET=i686-unknown-linux-musl
27+
# - env: TARGET=x86_64-unknown-linux-gnu # this is the default job
28+
- env: TARGET=x86_64-unknown-linux-musl
29+
30+
# OSX
31+
- env: TARGET=i686-apple-darwin
32+
os: osx
33+
- env: TARGET=x86_64-apple-darwin
34+
os: osx
35+
36+
# *BSD
37+
- env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
38+
- env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1
39+
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
40+
41+
# Other architectures
42+
- env: TARGET=aarch64-unknown-linux-gnu
43+
- env: TARGET=armv7-unknown-linux-gnueabihf
44+
- env: TARGET=mips-unknown-linux-gnu
45+
# - env: TARGET=mips64-unknown-linux-gnuabi64
46+
# - env: TARGET=mips64el-unknown-linux-gnuabi64
47+
- env: TARGET=mipsel-unknown-linux-gnu
48+
- env: TARGET=powerpc-unknown-linux-gnu
49+
# - env: TARGET=powerpc64-unknown-linux-gnu
50+
# - env: TARGET=powerpc64le-unknown-linux-gnu
51+
# - env: TARGET=s390x-unknown-linux-gnu
52+
- env: TARGET=arm-unknown-linux-gnueabi
53+
# - env: TARGET=arm-unknown-linux-musleabi
54+
55+
# Testing other channels
56+
- env: TARGET=x86_64-unknown-linux-gnu
57+
rust: nightly
58+
- env: TARGET=x86_64-apple-darwin
59+
os: osx
60+
rust: nightly
61+
62+
install:
63+
- sh ci/install.sh
64+
- source ~/.cargo/env || true
8565

8666
script:
87-
- bash ci/run-travis.sh
88-
- |
89-
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
90-
travis-cargo --only stable doc
91-
fi
92-
93-
after_success:
94-
- |
95-
if [ "$TRAVIS_OS_NAME" = "linux" ] && \
96-
[ "$TRAVIS_RUST_VERSION" = "stable" ] && \
97-
[ "$ARCH" = "x86_64" ]; then
98-
# Upload docs for stable (on master) to gh-pages
99-
travis-cargo --only stable doc-upload
100-
# Measure code coverage using kcov and upload to coveralls.io
101-
travis-cargo coveralls --no-sudo --verify
102-
fi
67+
- bash ci/script.sh
68+
69+
before_deploy:
70+
- sh ci/before_deploy.sh
71+
72+
deploy:
73+
# TODO update `api_key.secure`
74+
# - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new
75+
# - Encrypt it: `travis encrypt GH_TOKEN=0123456789012345678901234567890123456789`
76+
# - Paste the output down here
77+
api_key:
78+
secure: S1ktt0eqmfrEHnYPf4WO7mZtatz/FWfYWBp8nwdc0nd8H6UNZ9Dwy3tJpVe0N9rpB9vAFnkdw6R4jdkIcgxfory2F3F8k/mh8cWn0mkvh2N34YjHMYLnuVzOoFrWai7IcPfROpdlY0tGBlwNj5KMkeBnHUJzd2q4j/4j/tlrfmg=
79+
file_glob: true
80+
file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.*
81+
on:
82+
# Here you can pick which targets will generate binary releases
83+
# In this example, there are some targets that are tested using the stable
84+
# and nightly channels. This condition makes sure there is only one release
85+
# for such targets and that's generated using the stable channel
86+
#
87+
# Here we make it so we never generate binary releases
88+
condition: $DEPLOY = never
89+
tags: true
90+
provider: releases
91+
skip_cleanup: true
92+
93+
cache: cargo
94+
before_cache:
95+
# Travis can't cache files that are not readable by "others"
96+
- chmod -R a+r $HOME/.cargo
97+
98+
branches:
99+
only:
100+
# release tags
101+
- /^v\d+\.\d+\.\d+.*$/
102+
- master
103+
104+
notifications:
105+
email:
106+
on_success: never

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4141
([#508](https://github.com/nix-rust/nix/pull/508))
4242
- Fixed the style of many bitflags and use `libc` in more places.
4343
([#503](https://github.com/nix-rust/nix/pull/503))
44+
- Added `ppoll` in `::nix::poll`
45+
([#520](https://github.com/nix-rust/nix/pull/520))
4446

4547
### Changed
4648
- `::nix::sys::termios::{cfgetispeed, cfsetispeed, cfgetospeed, cfsetospeed}`

ci/README.md

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

ci/before_deploy.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This script takes care of packaging the build artifacts that will go in the
2+
# release zipfile
3+
4+
$SRC_DIR = $PWD.Path
5+
$STAGE = [System.Guid]::NewGuid().ToString()
6+
7+
Set-Location $ENV:Temp
8+
New-Item -Type Directory -Name $STAGE
9+
Set-Location $STAGE
10+
11+
$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
12+
13+
# TODO Update this to package the right artifacts
14+
Copy-Item "$SRC_DIR\target\$($Env:TARGET)\release\hello.exe" '.\'
15+
16+
7z a "$ZIP" *
17+
18+
Push-AppveyorArtifact "$ZIP"
19+
20+
Remove-Item *.* -Force
21+
Set-Location ..
22+
Remove-Item $STAGE
23+
Set-Location $SRC_DIR

ci/before_deploy.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This script takes care of building your crate and packaging it for release
2+
3+
set -ex
4+
5+
main() {
6+
local src=$(pwd) \
7+
stage=
8+
9+
case $TRAVIS_OS_NAME in
10+
linux)
11+
stage=$(mktemp -d)
12+
;;
13+
osx)
14+
stage=$(mktemp -d -t tmp)
15+
;;
16+
esac
17+
18+
test -f Cargo.lock || cargo generate-lockfile
19+
20+
# TODO Update this to build the artifacts that matter to you
21+
cross rustc --bin hello --target $TARGET --release -- -C lto
22+
23+
# TODO Update this to package the right artifacts
24+
cp target/$TARGET/release/hello $stage/
25+
26+
cd $stage
27+
tar czf $src/$CRATE_NAME-$TRAVIS_TAG-$TARGET.tar.gz *
28+
cd $src
29+
30+
rm -rf $stage
31+
}
32+
33+
main

ci/cargo-config

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

ci/install.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set -ex
2+
3+
main() {
4+
curl https://sh.rustup.rs -sSf | \
5+
sh -s -- -y --default-toolchain $TRAVIS_RUST_VERSION
6+
7+
local target=
8+
if [ $TRAVIS_OS_NAME = linux ]; then
9+
target=x86_64-unknown-linux-gnu
10+
else
11+
target=x86_64-apple-darwin
12+
fi
13+
14+
# TODO At some point you'll probably want to use a newer release of `cross`,
15+
# simply change the argument to `--tag`.
16+
curl -LSfs https://japaric.github.io/trust/install.sh | \
17+
sh -s -- \
18+
--force \
19+
--git japaric/cross \
20+
--tag v0.1.4 \
21+
--target $target
22+
}
23+
24+
main

ci/run-all.sh

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

0 commit comments

Comments
 (0)