From b9939e81000731525fb42958dccc6ad28c552ae2 Mon Sep 17 00:00:00 2001 From: Matthijs Brobbel Date: Wed, 24 Jun 2020 20:22:51 +0200 Subject: [PATCH 1/2] Setup GitHub actions --- .github/workflows/book.yml | 53 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 40 ++++++++++++++++++++++++++++ .travis.yml | 29 --------------------- README.md | 3 ++- 4 files changed, 95 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/book.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml new file mode 100644 index 00000000..592f6edc --- /dev/null +++ b/.github/workflows/book.yml @@ -0,0 +1,53 @@ +name: Book + +on: + push: + branches: + - master + pull_request: + paths: + - 'book/**' + +jobs: + build: + name: Build + runs-on: ubuntu-latest + env: + MDBOOK_VERSION: '0.4.0' + MDBOOK_LINKCHECK_VERSION: '0.7.0' + MDBOOK_MERMAID_VERSION: '^0.4' + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: ~/.cargo/bin + key: ${{ env.MDBOOK_MERMAID_VERSION }} + - name: Install mdbook + run: | + mkdir -p $HOME/mdbook $HOME/mdbook-linkcheck + curl -L https://github.com/rust-lang/mdBook/releases/download/v$MDBOOK_VERSION/mdbook-v$MDBOOK_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C $HOME/mdbook + echo "::add-path::${HOME}/mdbook/" + curl -L https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VERSION/mdbook-linkcheck-v$MDBOOK_LINKCHECK_VERSION-x86_64-unknown-linux-gnu.tar.gz | tar xz -C $HOME/mdbook-linkcheck + echo "::add-path::${HOME}/mdbook-linkcheck/" + mdbook-mermaid --version || cargo install mdbook-mermaid --version $MDBOOK_MERMAID_VERSION --debug + - name: Build + run: mdbook build + working-directory: book + - uses: actions/upload-artifact@v2 + with: + name: book + path: book/book/html + + deploy: + name: Deploy + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: actions/download-artifact@v2 + with: + name: book + - uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..ecbcc22e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: Test + +on: + push: + branches: + - master + pull_request: + paths: + - '**.rs' + - '**/Cargo.*' + +jobs: + test: + name: Test + strategy: + matrix: + rust: + - stable + - beta + experimental: + - false + include: + - rust: nightly + experimental: true + continue-on-error: ${{ matrix.experimental }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + default: true + - uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --all-targets + - uses: actions-rs/cargo@v1 + with: + command: test + args: --doc diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 17370daf..00000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: rust -sudo: false - -rust: - - nightly - - beta - - stable -cache: - - cargo -matrix: - allow_failures: - - rust: nightly -before_install: - - cargo install mdbook --version '0.3.1' --debug --force - - cargo install mdbook-linkcheck --version '0.4.0' --debug --force - - cargo install mdbook-mermaid --version '^0.4' --debug --force -script: - - RUST_BACKTRACE=1 CARGO_INCREMENTAL=0 cargo test --all - - RUST_BACKTRACE=1 CARGO_INCREMENTAL=0 cargo test --tests --all - - RUST_BACKTRACE=1 CARGO_INCREMENTAL=0 cargo test --examples --all - - cd book && mdbook build && mdbook test -deploy: - provider: pages - skip-cleanup: true - github-token: $GITHUB_TOKEN - local-dir: book/book/html - keep-history: false - on: - branch: master diff --git a/README.md b/README.md index b104993a..9ae209f2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # salsa -[![Build Status](https://travis-ci.org/salsa-rs/salsa.svg?branch=master)](https://travis-ci.org/salsa-rs/salsa) +[![Test](https://github.com/salsa-rs/salsa/workflows/Test/badge.svg)](https://github.com/salsa-rs/salsa/actions?query=workflow%3ATest) +[![Book](https://github.com/salsa-rs/salsa/workflows/Book/badge.svg)](https://github.com/salsa-rs/salsa/actions?query=workflow%3ABook) [![Released API docs](https://docs.rs/salsa/badge.svg)](https://docs.rs/salsa) [![Crates.io](https://img.shields.io/crates/v/salsa.svg)](https://crates.io/crates/salsa) From df56f62173e7efa919c4571ba2fd249fc08d31f3 Mon Sep 17 00:00:00 2001 From: Matthijs Brobbel Date: Thu, 25 Jun 2020 13:07:13 +0200 Subject: [PATCH 2/2] Add --all-features to doc tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ecbcc22e..fd40d5ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,4 +37,4 @@ jobs: - uses: actions-rs/cargo@v1 with: command: test - args: --doc + args: --all-features --doc