diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-12-26 19:58:03 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-12-26 20:46:42 +0100 |
commit | faf8b3edbaeb591315fc6f370c1228b8caf9860f (patch) | |
tree | d4120620a511a9a35e1ad44fa7414e2cd7a92f0d | |
parent | fde75f68e701b2f4b52a3655afba612187e20687 (diff) |
ci: Move the remaining CI tasks (updating the book) to GitHub actions.
-rw-r--r-- | .github/workflows/bindgen.yml | 19 | ||||
-rw-r--r-- | .github/workflows/deploy-book.yml | 34 | ||||
-rw-r--r-- | .travis.yml | 15 | ||||
-rwxr-xr-x | ci/deploy-book.sh | 33 | ||||
-rwxr-xr-x | ci/test-book.sh | 10 |
5 files changed, 53 insertions, 58 deletions
diff --git a/.github/workflows/bindgen.yml b/.github/workflows/bindgen.yml index 29309e82..933ac08d 100644 --- a/.github/workflows/bindgen.yml +++ b/.github/workflows/bindgen.yml @@ -148,3 +148,22 @@ jobs: BINDGEN_FEATURE_TESTING_ONLY_DOCS: ${{matrix.feature_testing_only_docs}} BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}} run: ./ci/test.sh + + test-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + # NOTE(emilio): Change deploy-book as well if you change this. + - name: Test book + run: | + cargo install mdbook --root mdbook-install --vers "^0.2.1" --force + ./mdbook-install/bin/mdbook build book + ./mdbook-install/bin/mdbook test book diff --git a/.github/workflows/deploy-book.yml b/.github/workflows/deploy-book.yml new file mode 100644 index 00000000..4244391a --- /dev/null +++ b/.github/workflows/deploy-book.yml @@ -0,0 +1,34 @@ +name: Deploy book + +on: + push: + branches: + - master + +jobs: + deploy-book: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Test book + run: | + cargo install mdbook --root mdbook-install --vers "^0.2.1" --force + ./mdbook-install/bin/mdbook build book + ./mdbook-install/bin/mdbook test book + + - name: Deploy book + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: book/book diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1e6d4f0a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: rust -dist: xenial -os: - - linux -rust: - - stable -env: - global: - - CARGO_TARGET_DIR=/tmp/bindgen -script: - - ./ci/test-book.sh -after_success: - - test "$TRAVIS_PULL_REQUEST" == "false" && - test "$TRAVIS_BRANCH" == "master" && - ./ci/deploy-book.sh diff --git a/ci/deploy-book.sh b/ci/deploy-book.sh deleted file mode 100755 index 740e095a..00000000 --- a/ci/deploy-book.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -set -xeu -cd "$(dirname "$0")/../book" - -# Ensure mdbook is installed. -cargo install mdbook --vers "^0.2.1" --force || true -export PATH="$PATH:~/.cargo/bin" - -# Get the git revision we are on. -rev=$(git rev-parse --short HEAD) - -# Build the users guide book and go into the built book's directory. -rm -rf ./book -mdbook build -cd ./book - -# Make the built book directory a new git repo, fetch upstream, make a new -# commit on gh-pages, and push it upstream. - -git init -git config user.name "Travis CI" -git config user.email "builds@travis-ci.org" - -git remote add upstream "https://$GH_TOKEN@github.com/rust-lang/rust-bindgen.git" -git fetch upstream -git reset upstream/gh-pages - -touch . - -git add -A . -git commit -m "Rebuild users guide at ${rev}" -git push upstream HEAD:gh-pages diff --git a/ci/test-book.sh b/ci/test-book.sh deleted file mode 100755 index bc2ea333..00000000 --- a/ci/test-book.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -xeu -cd "$(dirname "$0")/../book" - -cargo install mdbook --vers "^0.2.1" --force || true -export PATH="$PATH:~/.cargo/bin" - -mdbook build -mdbook test |