Deindent YAML

This commit is contained in:
Aleksey Kladov 2020-03-04 17:01:38 +01:00
parent 51c358f9cc
commit ff17b0ba48
3 changed files with 233 additions and 230 deletions

View file

@ -3,28 +3,30 @@ on:
pull_request: pull_request:
push: push:
branches: branches:
- master - master
- staging - staging
- trying - trying
jobs: jobs:
rust-audit: rust-audit:
name: Audit Rust vulnerabilities name: Audit Rust vulnerabilities
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v1 uses: actions/checkout@v1
- run: cargo install cargo-audit - run: cargo install cargo-audit
- run: cargo audit - run: cargo audit
rust: rust:
name: Rust name: Rust
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
env: env:
RUSTFLAGS: -D warnings RUSTFLAGS: -D warnings
CC: deny_c CC: deny_c
@ -32,62 +34,62 @@ jobs:
RUN_SLOW_TESTS: 1 RUN_SLOW_TESTS: 1
RUSTUP_MAX_RETRIES: 10 RUSTUP_MAX_RETRIES: 10
CARGO_NET_RETRY: 10 CARGO_NET_RETRY: 10
steps: steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Checkout repository # We need to disable the existing toolchain to avoid updating rust-docs
uses: actions/checkout@v1 # which takes a long time. The fastest way to do this is to rename the
# existing folder, as deleting it takes about as much time as not doing
# anything and just updating rust-docs.
- name: Rename existing rust toolchain (Windows)
if: matrix.os == 'windows-latest'
run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
# We need to disable the existing toolchain to avoid updating rust-docs - name: Install Rust toolchain
# which takes a long time. The fastest way to do this is to rename the uses: actions-rs/toolchain@v1
# existing folder, as deleting it takes about as much time as not doing with:
# anything and just updating rust-docs. toolchain: stable
- name: Rename existing rust toolchain (Windows) profile: minimal
if: matrix.os == 'windows-latest' override: true
run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old components: rustfmt, rust-src
- name: Install Rust toolchain - name: Cache cargo registry
uses: actions-rs/toolchain@v1 uses: actions/cache@v1
with: with:
toolchain: stable path: ~/.cargo/registry
profile: minimal key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
override: true
components: rustfmt, rust-src
- name: Cache cargo registry - name: Cache cargo index
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/registry path: ~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index - name: Cache cargo target dir
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/git path: target
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo target dir - name: Compile
uses: actions/cache@v1 uses: actions-rs/cargo@v1
with: with:
path: target command: test
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} args: --no-run
- name: Compile - name: Test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --no-run
- name: Test - name: Prepare cache
uses: actions-rs/cargo@v1 run: cargo xtask pre-cache
with:
command: test
- name: Prepare cache - name: Prepare cache 2
run: cargo xtask pre-cache if: matrix.os == 'windows-latest'
run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
- name: Prepare cache 2
if: matrix.os == 'windows-latest'
run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
typescript: typescript:
name: TypeScript name: TypeScript
@ -96,22 +98,22 @@ jobs:
CXX: g++-4.9 CXX: g++-4.9
CC: gcc-4.9 CC: gcc-4.9
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v1 uses: actions/checkout@v1
- 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
- run: npm ci - run: npm ci
working-directory: ./editors/code working-directory: ./editors/code
- run: npm audit - run: npm audit
working-directory: ./editors/code working-directory: ./editors/code
- run: npm run lint - run: npm run lint
working-directory: ./editors/code working-directory: ./editors/code
- run: npm run package --scripts-prepend-node-path - run: npm run package --scripts-prepend-node-path
working-directory: ./editors/code working-directory: ./editors/code

View file

@ -2,7 +2,7 @@ name: release
on: on:
push: push:
branches: branches:
- release - release
jobs: jobs:
build-server: build-server:
@ -11,183 +11,184 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
env: env:
RUSTFLAGS: -D warnings RUSTFLAGS: -D warnings
CARGO_INCREMENTAL: 0 CARGO_INCREMENTAL: 0
RUSTUP_MAX_RETRIES: 10 RUSTUP_MAX_RETRIES: 10
CARGO_NET_RETRY: 10 CARGO_NET_RETRY: 10
steps: steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Checkout repository # We need to disable the existing toolchain to avoid updating rust-docs
uses: actions/checkout@v1 # which takes a long time. The fastest way to do this is to rename the
# existing folder, as deleting it takes about as much time as not doing
# anything and just updating rust-docs.
- name: Rename existing rust toolchain (Windows)
if: matrix.os == 'windows-latest'
run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
# We need to disable the existing toolchain to avoid updating rust-docs - name: Install Rust toolchain
# which takes a long time. The fastest way to do this is to rename the uses: actions-rs/toolchain@v1
# existing folder, as deleting it takes about as much time as not doing with:
# anything and just updating rust-docs. toolchain: stable
- name: Rename existing rust toolchain (Windows) profile: minimal
if: matrix.os == 'windows-latest' target: x86_64-unknown-linux-musl
run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old override: true
- name: Install Rust toolchain - name: Build
uses: actions-rs/toolchain@v1 if: matrix.os == 'ubuntu-latest'
with: uses: actions-rs/cargo@v1
toolchain: stable env:
profile: minimal CC: clang
target: x86_64-unknown-linux-musl with:
override: true command: build
args: --package rust-analyzer --bin rust-analyzer --release --target x86_64-unknown-linux-musl
- name: Build - name: Build
if: matrix.os == 'ubuntu-latest' if: matrix.os != 'ubuntu-latest'
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
env: with:
CC: clang command: build
with: args: --package rust-analyzer --bin rust-analyzer --release
command: build
args: --package rust-analyzer --bin rust-analyzer --release --target x86_64-unknown-linux-musl
- name: Build - name: Create distribution dir
if: matrix.os != 'ubuntu-latest' run: mkdir ./dist
uses: actions-rs/cargo@v1
with:
command: build
args: --package rust-analyzer --bin rust-analyzer --release
- name: Create distribution dir - name: Copy binary
run: mkdir ./dist if: matrix.os == 'ubuntu-latest'
run: cp ./target/x86_64-unknown-linux-musl/release/rust-analyzer ./dist/rust-analyzer-linux && strip ./dist/rust-analyzer-linux
- name: Copy binary - name: Copy binary
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'macos-latest'
run: cp ./target/x86_64-unknown-linux-musl/release/rust-analyzer ./dist/rust-analyzer-linux && strip ./dist/rust-analyzer-linux run: cp ./target/release/rust-analyzer ./dist/rust-analyzer-mac
- name: Copy binary - name: Copy binary
if: matrix.os == 'macos-latest' if: matrix.os == 'windows-latest'
run: cp ./target/release/rust-analyzer ./dist/rust-analyzer-mac run: copy ./target/release/rust-analyzer.exe ./dist/rust-analyzer-windows.exe
- name: Copy binary - name: Upload artifacts
if: matrix.os == 'windows-latest' uses: actions/upload-artifact@v1
run: copy ./target/release/rust-analyzer.exe ./dist/rust-analyzer-windows.exe with:
name: server-${{ matrix.os }}
- name: Upload artifacts path: ./dist
uses: actions/upload-artifact@v1
with:
name: server-${{ matrix.os }}
path: ./dist
build-clients: build-clients:
name: build-clients name: build-clients
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v1 uses: actions/checkout@v1
- 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
- run: npm ci - run: npm ci
working-directory: ./editors/code working-directory: ./editors/code
- run: npm run package --scripts-prepend-node-path - run: npm run package --scripts-prepend-node-path
working-directory: ./editors/code working-directory: ./editors/code
- name: Copy vscode extension - name: Copy vscode extension
run: mkdir -p ./dist/code && cp ./editors/code/rust-analyzer.vsix ./dist/ run: mkdir -p ./dist/code && cp ./editors/code/rust-analyzer.vsix ./dist/
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v1 uses: actions/upload-artifact@v1
with: with:
name: editor-plugins name: editor-plugins
path: ./dist path: ./dist
make-release: make-release:
name: make-release name: make-release
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: ['build-server', 'build-clients'] needs: ['build-server', 'build-clients']
steps: steps:
- 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
- run: echo "::set-env name=TAG::$(date --iso)" - run: echo "::set-env name=TAG::$(date --iso)"
- run: 'echo "TAG: $TAG"' - run: 'echo "TAG: $TAG"'
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v1 uses: actions/checkout@v1
- uses: actions/download-artifact@v1 - uses: actions/download-artifact@v1
with: with:
name: editor-plugins name: editor-plugins
path: dist path: dist
- uses: actions/download-artifact@v1 - uses: actions/download-artifact@v1
with: with:
name: server-macos-latest name: server-macos-latest
path: dist path: dist
- uses: actions/download-artifact@v1 - uses: actions/download-artifact@v1
with: with:
name: server-ubuntu-latest name: server-ubuntu-latest
path: dist path: dist
- uses: actions/download-artifact@v1 - uses: actions/download-artifact@v1
with: with:
name: server-windows-latest name: server-windows-latest
path: dist path: dist
- run: ls -all ./dist - run: ls -all ./dist
- name: Create Release - name: Create Release
id: create_release id: create_release
# uses: actions/create-release@v1 # uses: actions/create-release@v1
# https://github.com/actions/create-release/pull/32 # https://github.com/actions/create-release/pull/32
uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ${{ env.TAG }} tag_name: ${{ env.TAG }}
release_name: ${{ env.TAG }} release_name: ${{ env.TAG }}
draft: false draft: false
prerelease: false prerelease: false
- uses: actions/upload-release-asset@v1.0.1 - uses: actions/upload-release-asset@v1.0.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/rust-analyzer-linux asset_path: ./dist/rust-analyzer-linux
asset_name: rust-analyzer-linux asset_name: rust-analyzer-linux
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.1 - uses: actions/upload-release-asset@v1.0.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/rust-analyzer-mac asset_path: ./dist/rust-analyzer-mac
asset_name: rust-analyzer-mac asset_name: rust-analyzer-mac
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.1 - uses: actions/upload-release-asset@v1.0.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/rust-analyzer-windows.exe asset_path: ./dist/rust-analyzer-windows.exe
asset_name: rust-analyzer-windows.exe asset_name: rust-analyzer-windows.exe
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.1 - uses: actions/upload-release-asset@v1.0.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/rust-analyzer.vsix asset_path: ./dist/rust-analyzer.vsix
asset_name: rust-analyzer.vsix asset_name: rust-analyzer.vsix
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
- run: npm ci - run: npm ci
working-directory: ./editors/code working-directory: ./editors/code
- name: Publish Extension - name: Publish Extension
working-directory: ./editors/code working-directory: ./editors/code
# token from https://dev.azure.com/rust-analyzer/ # token from https://dev.azure.com/rust-analyzer/
run: npx vsce publish 0.1.$(date +%Y%m%d) --pat ${{ secrets.MARKETPLACE_TOKEN }} run: npx vsce publish 0.1.$(date +%Y%m%d) --pat ${{ secrets.MARKETPLACE_TOKEN }}

View file

@ -2,7 +2,7 @@ name: rustdoc
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
rustdoc: rustdoc:
@ -12,28 +12,28 @@ jobs:
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:
toolchain: stable toolchain: stable
profile: minimal profile: minimal
override: true override: true
components: rustfmt, rust-src components: rustfmt, rust-src
- name: Build Documentation - name: Build Documentation
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: doc command: doc
args: --all --no-deps args: --all --no-deps
- name: Deploy Docs - name: Deploy Docs
uses: peaceiris/actions-gh-pages@v2.6.0-rc0 uses: peaceiris/actions-gh-pages@v2.6.0-rc0
env: env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./target/doc PUBLISH_DIR: ./target/doc
with: with:
forceOrphan: true forceOrphan: true