mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Switch to Actions
This commit is contained in:
parent
396853defb
commit
34025020b5
4 changed files with 61 additions and 97 deletions
51
.github/workflows/ci.yaml
vendored
51
.github/workflows/ci.yaml
vendored
|
@ -1,16 +1,23 @@
|
||||||
name: Continuous integration
|
name: CI
|
||||||
on: [pull_request, push]
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- staging
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rust-tests:
|
rust:
|
||||||
name: Rust tests
|
name: Rust
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: -D warnings
|
RUSTFLAGS: -D warnings
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
@ -18,31 +25,32 @@ jobs:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
override: true
|
override: true
|
||||||
components: rustfmt, rust-src
|
components: rustfmt, rust-src
|
||||||
- name: Generate lockfile
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: generate-lockfile
|
|
||||||
- name: Cargo target cache
|
- name: Cargo target cache
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: target
|
path: target
|
||||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Compile
|
- name: Compile
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --no-run
|
args: --no-run
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
|
|
||||||
- name: Prepare build directory for cache
|
- name: Prepare build directory for cache
|
||||||
run: |
|
run: |
|
||||||
find ./target/debug -maxdepth 1 -type f -delete && \
|
find ./target/debug -maxdepth 1 -type f -delete && \
|
||||||
rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} && \
|
rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} && \
|
||||||
rm -f ./target/.rustc_info.json
|
rm -f ./target/.rustc_info.json
|
||||||
vscode-tests:
|
|
||||||
name: VS Code tests
|
type-script:
|
||||||
|
name: TypeScript
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
CXX: g++-4.9
|
CXX: g++-4.9
|
||||||
|
@ -50,25 +58,12 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v1
|
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
|
- name: Install Nodejs
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12.x
|
node-version: 12.x
|
||||||
|
|
||||||
- name: Install xvfb
|
- name: Install xvfb
|
||||||
run: sudo apt-get install xvfb
|
run: sudo apt-get install xvfb
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
|
@ -77,10 +72,6 @@ jobs:
|
||||||
working-directory: ./editors/code
|
working-directory: ./editors/code
|
||||||
- run: xvfb-run --auto-servernum npm run travis
|
- run: xvfb-run --auto-servernum npm run travis
|
||||||
working-directory: ./editors/code
|
working-directory: ./editors/code
|
||||||
|
|
||||||
- name: Cleanup xvfb
|
- name: Cleanup xvfb
|
||||||
uses: bcomnes/cleanup-xvfb@v1
|
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
39
.github/workflows/rustdoc.yaml
vendored
Normal 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
|
64
.travis.yml
64
.travis.yml
|
@ -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
|
|
|
@ -1,4 +1,2 @@
|
||||||
status = [
|
status = ["CI / Rust", "CI / TypeScript"]
|
||||||
"continuous-integration/travis-ci/push",
|
|
||||||
]
|
|
||||||
delete_merged_branches = true
|
delete_merged_branches = true
|
||||||
|
|
Loading…
Reference in a new issue