Switch to Actions

This commit is contained in:
Aleksey Kladov 2019-11-18 11:13:31 +03:00
parent 396853defb
commit 34025020b5
4 changed files with 61 additions and 97 deletions

View file

@ -1,16 +1,23 @@
name: Continuous integration
on: [pull_request, push]
name: CI
on:
pull_request:
push:
branches:
- master
- staging
jobs:
rust-tests:
name: Rust tests
rust:
name: Rust
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: 0
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
@ -18,31 +25,32 @@ jobs:
profile: minimal
override: true
components: rustfmt, rust-src
- name: Generate lockfile
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Cargo target cache
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Compile
uses: actions-rs/cargo@v1
with:
command: test
args: --no-run
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Prepare build directory for cache
run: |
find ./target/debug -maxdepth 1 -type f -delete && \
rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} && \
rm -f ./target/.rustc_info.json
vscode-tests:
name: VS Code tests
type-script:
name: TypeScript
runs-on: ubuntu-latest
env:
CXX: g++-4.9
@ -50,25 +58,12 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Generate lockfile
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Cargo target cache
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Install Nodejs
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install xvfb
run: sudo apt-get install xvfb
- run: npm ci
@ -77,10 +72,6 @@ jobs:
working-directory: ./editors/code
- run: xvfb-run --auto-servernum npm run travis
working-directory: ./editors/code
- name: Cleanup xvfb
uses: bcomnes/cleanup-xvfb@v1
- name: Prepare build directory for cache
run: |
find ./target/debug -maxdepth 1 -type f -delete && \
rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} && \
rm -f ./target/.rustc_info.json

39
.github/workflows/rustdoc.yaml vendored Normal file
View file

@ -0,0 +1,39 @@
name: rustdoc
on:
push:
branches:
- master
jobs:
rustdoc:
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: 0
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, rust-src
- name: Build Documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --no-deps
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v2.6.0-rc0
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./target/doc
with:
forceOrphan: true

View file

@ -1,64 +0,0 @@
cache: cargo
before_cache:
- find ./target/debug -maxdepth 1 -type f -delete
- rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*}
- rm -f ./target/.rustc_info.json
matrix:
include:
- name: "Rust Tests"
os: linux
dist: xenial
language: rust
rust: stable
script:
- rustup component add rustfmt
- rustup component add rust-src
- cargo test --no-run # let's measure compile time separately
- cargo test
env:
- RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0
- name: "Rust Docs"
os: linux
if: branch = master AND type = push
before_script:
- DEPLOY_DOCS=1
language: rust
rust: stable
script:
- cargo doc --all --no-deps
env:
- RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0
- name: "VS Code Tests"
os: linux
language: node_js
dist: xenial
node_js: node
services:
- xvfb
before_install: cd editors/code
install:
- npm ci
- npm run vscode:prepublish
script:
- npm run travis
env:
- CXX="g++-4.9", CC="gcc-4.9"
branches:
only:
- staging
- master
- trying
deploy:
provider: pages
skip-cleanup: true
github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable
keep-history: false
local-dir: target/doc
on:
branch: master
condition: $DEPLOY_DOCS = 1

View file

@ -1,4 +1,2 @@
status = [
"continuous-integration/travis-ci/push",
]
status = ["CI / Rust", "CI / TypeScript"]
delete_merged_branches = true