diff --git a/.github/workflows/bindgen.yml b/.github/workflows/bindgen.yml index 29309e8270..933ac08d67 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 0000000000..4244391add --- /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 1e6d4f0aec..0000000000 --- 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 740e095acb..0000000000 --- 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 bc2ea333f5..0000000000 --- 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