From 60db0c130bc1d8ab2b373ff6a6fa5c33492ce32b Mon Sep 17 00:00:00 2001 From: Adam Greig Date: Mon, 5 Apr 2021 23:19:32 +0100 Subject: [PATCH 1/2] Swap to GHA. --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 20 -------------- ci/after-success.sh | 17 ------------ ci/install.sh | 20 -------------- ci/script.sh | 40 ---------------------------- 5 files changed, 56 insertions(+), 97 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100644 ci/after-success.sh delete mode 100644 ci/install.sh delete mode 100644 ci/script.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e8dd421 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: [ staging, trying, master ] + pull_request: + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: default + toolchain: stable + - name: Install Python dependencies + run: | + pip3 install --user python-dateutil linkchecker + - name: Put pip binary directory into path + run: echo "~/.local/bin" >> $GITHUB_PATH + - name: Create doc directory + run: mkdir doc + - name: Download static content + env: + url: https://github.com/rust-lang/rust/raw/1.29.0/src + working-directory: doc + run: | + curl -LO $url/doc/rust.css + curl -LO $url/librustdoc/html/static/FiraSans-Regular.woff + curl -LO $url/librustdoc/html/static/FiraSans-Medium.woff + curl -LO $url/librustdoc/html/static/FiraSans-LICENSE.txt + curl -LO $url/librustdoc/html/static/Heuristica-Italic.woff + curl -LO $url/librustdoc/html/static/Heuristica-LICENSE.txt + curl -LO $url/librustdoc/html/static/SourceSerifPro-Regular.woff + curl -LO $url/librustdoc/html/static/SourceSerifPro-Bold.woff + curl -LO $url/librustdoc/html/static/SourceSerifPro-LICENSE.txt + curl -LO $url/librustdoc/html/static/SourceCodePro-Regular.woff + curl -LO $url/librustdoc/html/static/SourceCodePro-Semibold.woff + curl -LO $url/librustdoc/html/static/SourceCodePro-LICENSE.txt + curl -LO $url/librustdoc/html/static/LICENSE-MIT.txt + curl -LO $url/librustdoc/html/static/LICENSE-APACHE.txt + curl -LO $url/librustdoc/html/static/COPYRIGHT.txt + - name: Build webpage + run: | + rustdoc --markdown-css rust.css --markdown-no-toc index.md + rustdoc --markdown-css rust.css faq.md + - name: Check links + run: linkchecker doc + - name: Deploy webpage + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: doc + force_orphan: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 99e54d8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: rust - -install: - - bash ci/install.sh - -script: - - bash ci/script.sh - -after_success: - - bash ci/after-success.sh - -branches: - only: - - master - - staging - - trying - -notifications: - email: - on_success: never diff --git a/ci/after-success.sh b/ci/after-success.sh deleted file mode 100644 index 99382c7..0000000 --- a/ci/after-success.sh +++ /dev/null @@ -1,17 +0,0 @@ -set -euxo pipefail - -main() { - mkdir ghp-import - curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz | - tar --strip-components 1 -C ghp-import -xz - - ./ghp-import/ghp_import.py --cname=docs.rust-embedded.org doc - - # NOTE(+x) don't print $GH_TOKEN to the console! - set +x - git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK -} - -if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]; then - main -fi diff --git a/ci/install.sh b/ci/install.sh deleted file mode 100644 index 756bcd8..0000000 --- a/ci/install.sh +++ /dev/null @@ -1,20 +0,0 @@ -set -euxo pipefail - -main() { - local tag=$(git ls-remote --tags --refs --exit-code \ - https://github.com/rust-lang/mdbook \ - | cut -d/ -f3 \ - | grep -E '^v[0-9\.]+$' \ - | sort --version-sort \ - | tail -n1) - - curl -LSfs https://japaric.github.io/trust/install.sh | \ - sh -s -- \ - --force \ - --git rust-lang/mdbook \ - --tag $tag - - pip install linkchecker python-dateutil --user -} - -main diff --git a/ci/script.sh b/ci/script.sh deleted file mode 100644 index 6af9e5c..0000000 --- a/ci/script.sh +++ /dev/null @@ -1,40 +0,0 @@ -set -euxo pipefail - -main() { - # release from which we extract CSS and fonts - local tag=1.29.0 - - rm -rf doc - - mkdir doc - - # CSS and fonts and their licenses - pushd doc - curl -LO https://github.com/rust-lang/rust/raw/$tag/src/doc/rust.css - local static=https://github.com/rust-lang/rust/raw/$tag/src/librustdoc/html/static - curl -LO $static/FiraSans-Regular.woff - curl -LO $static/FiraSans-Medium.woff - curl -LO $static/FiraSans-LICENSE.txt - curl -LO $static/Heuristica-Italic.woff - curl -LO $static/Heuristica-LICENSE.txt - curl -LO $static/SourceSerifPro-Regular.woff - curl -LO $static/SourceSerifPro-Bold.woff - curl -LO $static/SourceSerifPro-LICENSE.txt - curl -LO $static/SourceCodePro-Regular.woff - curl -LO $static/SourceCodePro-Semibold.woff - curl -LO $static/SourceCodePro-LICENSE.txt - curl -LO $static/LICENSE-MIT.txt - curl -LO $static/LICENSE-APACHE.txt - curl -LO $static/COPYRIGHT.txt - popd - - # build index page - rustdoc --markdown-css rust.css --markdown-no-toc index.md - rustdoc --markdown-css rust.css faq.md - - # check links - # FIXME(rust-lang-nursery/mdbook#789) remove `--ignore-url` when that bug is fixed - linkchecker --ignore-url "print.html" doc -} - -main From 82f41fe0a7a4e63ebdede7558a123cfc2a751fa4 Mon Sep 17 00:00:00 2001 From: Adam Greig Date: Mon, 5 Apr 2021 23:22:30 +0100 Subject: [PATCH 2/2] Add bors config --- .github/bors.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/bors.toml diff --git a/.github/bors.toml b/.github/bors.toml new file mode 100644 index 0000000..c3cfa37 --- /dev/null +++ b/.github/bors.toml @@ -0,0 +1,4 @@ +block_labels = ["needs-decision"] +delete_merged_branches = true +required_approvals = 1 +status = ["build"]