-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1071 from ehuss/github-actions
Switch to GitHub Actions.
- Loading branch information
Showing
11 changed files
with
214 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Deploy | ||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
release: | ||
name: Deploy Release | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Install hub | ||
run: ci/install-hub.sh ${{ matrix.os }} | ||
shell: bash | ||
- name: Install Rustup | ||
run: ci/install-rustup.sh stable | ||
shell: bash | ||
- name: Install Rust | ||
run: ci/install-rust.sh stable | ||
shell: bash | ||
- name: Build and deploy artifacts | ||
run: ci/make-release.sh ${{ matrix.os }} | ||
shell: bash | ||
pages: | ||
name: GitHub Pages | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Install Rust (rustup) | ||
run: rustup update stable --no-self-update && rustup default stable | ||
- name: Deploy to GitHub Pages | ||
run: ci/deploy-gh-pages.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: CI | ||
on: | ||
# Only run when merging to master, or open/synchronize/reopen a PR. | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
build: [stable, beta, nightly, macos, windows, msrv] | ||
include: | ||
- build: stable | ||
os: ubuntu-latest | ||
rust: stable | ||
- build: beta | ||
os: ubuntu-latest | ||
rust: beta | ||
- build: nightly | ||
os: ubuntu-latest | ||
rust: nightly | ||
- build: macos | ||
os: macos-latest | ||
rust: stable | ||
- build: windows | ||
os: windows-latest | ||
rust: stable | ||
- build: msrv | ||
os: ubuntu-latest | ||
rust: 1.35.0 | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Install Rustup | ||
run: bash ci/install-rustup.sh ${{ matrix.rust }} | ||
- name: Install Rust | ||
run: bash ci/install-rust.sh ${{ matrix.rust }} | ||
- name: Build and run tests | ||
run: cargo test | ||
- name: Test no default | ||
run: cargo test --no-default-features | ||
|
||
rustfmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Install Rust | ||
run: rustup update stable && rustup default stable && rustup component add rustfmt | ||
- run: cargo fmt -- --check |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# Updates gh-pages with latest docs. | ||
set -ex | ||
|
||
cargo run -- build book-example | ||
cd book-example/book | ||
touch .nojekyll | ||
git init | ||
git config --local user.email "" | ||
git config --local user.name "GitHub Deployer" | ||
git add . | ||
git commit -m "Deploy to gh-pages" | ||
remote="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
git push "$remote" HEAD:gh-pages --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# Installs the `hub` executable into hub/bin | ||
set -ex | ||
case $1 in | ||
ubuntu*) | ||
curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-linux-amd64-2.12.8.tgz -o hub.tgz | ||
mkdir hub | ||
tar -xzvf hub.tgz --strip=1 -C hub | ||
;; | ||
macos*) | ||
curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-darwin-amd64-2.12.8.tgz -o hub.tgz | ||
mkdir hub | ||
tar -xzvf hub.tgz --strip=1 -C hub | ||
;; | ||
windows*) | ||
curl -LsSf https://github.com/github/hub/releases/download/v2.12.8/hub-windows-amd64-2.12.8.zip -o hub.zip | ||
7z x hub.zip -ohub | ||
;; | ||
*) | ||
echo "OS should be first parameter, was: $1" | ||
;; | ||
esac | ||
|
||
echo "##[add-path]$PWD/hub/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
# Install/update rust. | ||
# The first argument should be the toolchain to install. | ||
|
||
set -ex | ||
if [ -z "$1" ] | ||
then | ||
echo "First parameter must be toolchain to install." | ||
exit 1 | ||
fi | ||
TOOLCHAIN="$1" | ||
|
||
rustup set profile minimal | ||
rustup component remove --toolchain=$TOOLCHAIN rust-docs || echo "already removed" | ||
rustup update $TOOLCHAIN | ||
rustup default $TOOLCHAIN | ||
rustup -V | ||
rustc -Vv | ||
cargo -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
# Install/update rustup. | ||
# The first argument should be the toolchain to install. | ||
# | ||
# It is helpful to have this as a separate script due to some issues on | ||
# Windows where immediately after `rustup self update`, rustup can fail with | ||
# "Device or resource busy". | ||
|
||
set -ex | ||
if [ -z "$1" ] | ||
then | ||
echo "First parameter must be toolchain to install." | ||
exit 1 | ||
fi | ||
TOOLCHAIN="$1" | ||
|
||
# Install/update rustup. | ||
if command -v rustup | ||
then | ||
echo `command -v rustup` `rustup -V` already installed | ||
rustup self update | ||
else | ||
# macOS currently does not have rust pre-installed. | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $TOOLCHAIN --profile=minimal | ||
echo "##[add-path]$HOME/.cargo/bin" | ||
fi |
Oops, something went wrong.