aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-04 16:01:38 +0000
committerAleksey Kladov <[email protected]>2020-03-04 16:01:38 +0000
commitff17b0ba48fbf80d9672909e4c5f9f833257336e (patch)
tree175da328f87a2ff31716f43fdf5d3732850f0025 /.github/workflows
parent51c358f9cc95fc30bb7703f493f9a960b84ca2d1 (diff)
Deindent YAML
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yaml154
-rw-r--r--.github/workflows/release.yaml319
-rw-r--r--.github/workflows/rustdoc.yaml46
3 files changed, 261 insertions, 258 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 50c4265cf..74ce147ae 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -3,28 +3,30 @@ on:
3 pull_request: 3 pull_request:
4 push: 4 push:
5 branches: 5 branches:
6 - master 6 - master
7 - staging 7 - staging
8 - trying 8 - trying
9 9
10jobs: 10jobs:
11 rust-audit: 11 rust-audit:
12 name: Audit Rust vulnerabilities 12 name: Audit Rust vulnerabilities
13 runs-on: ubuntu-latest 13 runs-on: ubuntu-latest
14 steps: 14 steps:
15 - name: Checkout repository 15 - name: Checkout repository
16 uses: actions/checkout@v1 16 uses: actions/checkout@v1
17 17
18 - run: cargo install cargo-audit 18 - run: cargo install cargo-audit
19 - run: cargo audit 19 - run: cargo audit
20 20
21 rust: 21 rust:
22 name: Rust 22 name: Rust
23 runs-on: ${{ matrix.os }} 23 runs-on: ${{ matrix.os }}
24
24 strategy: 25 strategy:
25 fail-fast: false 26 fail-fast: false
26 matrix: 27 matrix:
27 os: [ubuntu-latest, windows-latest, macos-latest] 28 os: [ubuntu-latest, windows-latest, macos-latest]
29
28 env: 30 env:
29 RUSTFLAGS: -D warnings 31 RUSTFLAGS: -D warnings
30 CC: deny_c 32 CC: deny_c
@@ -32,62 +34,62 @@ jobs:
32 RUN_SLOW_TESTS: 1 34 RUN_SLOW_TESTS: 1
33 RUSTUP_MAX_RETRIES: 10 35 RUSTUP_MAX_RETRIES: 10
34 CARGO_NET_RETRY: 10 36 CARGO_NET_RETRY: 10
35 steps:
36 37
37 - name: Checkout repository 38 steps:
38 uses: actions/checkout@v1 39 - name: Checkout repository
39 40 uses: actions/checkout@v1
40 # We need to disable the existing toolchain to avoid updating rust-docs 41
41 # which takes a long time. The fastest way to do this is to rename the 42 # We need to disable the existing toolchain to avoid updating rust-docs
42 # existing folder, as deleting it takes about as much time as not doing 43 # which takes a long time. The fastest way to do this is to rename the
43 # anything and just updating rust-docs. 44 # existing folder, as deleting it takes about as much time as not doing
44 - name: Rename existing rust toolchain (Windows) 45 # anything and just updating rust-docs.
45 if: matrix.os == 'windows-latest' 46 - name: Rename existing rust toolchain (Windows)
46 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 47 if: matrix.os == 'windows-latest'
47 48 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
48 - name: Install Rust toolchain 49
49 uses: actions-rs/toolchain@v1 50 - name: Install Rust toolchain
50 with: 51 uses: actions-rs/toolchain@v1
51 toolchain: stable 52 with:
52 profile: minimal 53 toolchain: stable
53 override: true 54 profile: minimal
54 components: rustfmt, rust-src 55 override: true
55 56 components: rustfmt, rust-src
56 - name: Cache cargo registry 57
57 uses: actions/cache@v1 58 - name: Cache cargo registry
58 with: 59 uses: actions/cache@v1
59 path: ~/.cargo/registry 60 with:
60 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} 61 path: ~/.cargo/registry
61 62 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
62 - name: Cache cargo index 63
63 uses: actions/cache@v1 64 - name: Cache cargo index
64 with: 65 uses: actions/cache@v1
65 path: ~/.cargo/git 66 with:
66 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} 67 path: ~/.cargo/git
67 68 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
68 - name: Cache cargo target dir 69
69 uses: actions/cache@v1 70 - name: Cache cargo target dir
70 with: 71 uses: actions/cache@v1
71 path: target 72 with:
72 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} 73 path: target
73 74 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
74 - name: Compile 75
75 uses: actions-rs/cargo@v1 76 - name: Compile
76 with: 77 uses: actions-rs/cargo@v1
77 command: test 78 with:
78 args: --no-run 79 command: test
79 80 args: --no-run
80 - name: Test 81
81 uses: actions-rs/cargo@v1 82 - name: Test
82 with: 83 uses: actions-rs/cargo@v1
83 command: test 84 with:
84 85 command: test
85 - name: Prepare cache 86
86 run: cargo xtask pre-cache 87 - name: Prepare cache
87 88 run: cargo xtask pre-cache
88 - name: Prepare cache 2 89
89 if: matrix.os == 'windows-latest' 90 - name: Prepare cache 2
90 run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe 91 if: matrix.os == 'windows-latest'
92 run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
91 93
92 typescript: 94 typescript:
93 name: TypeScript 95 name: TypeScript
@@ -96,22 +98,22 @@ jobs:
96 CXX: g++-4.9 98 CXX: g++-4.9
97 CC: gcc-4.9 99 CC: gcc-4.9
98 steps: 100 steps:
99 - name: Checkout repository 101 - name: Checkout repository
100 uses: actions/checkout@v1 102 uses: actions/checkout@v1
101 103
102 - name: Install Nodejs 104 - name: Install Nodejs
103 uses: actions/setup-node@v1 105 uses: actions/setup-node@v1
104 with: 106 with:
105 node-version: 12.x 107 node-version: 12.x
106 108
107 - run: npm ci 109 - run: npm ci
108 working-directory: ./editors/code 110 working-directory: ./editors/code
109 111
110 - run: npm audit 112 - run: npm audit
111 working-directory: ./editors/code 113 working-directory: ./editors/code
112 114
113 - run: npm run lint 115 - run: npm run lint
114 working-directory: ./editors/code 116 working-directory: ./editors/code
115 117
116 - run: npm run package --scripts-prepend-node-path 118 - run: npm run package --scripts-prepend-node-path
117 working-directory: ./editors/code 119 working-directory: ./editors/code
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index a697c0071..fe893e005 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -2,7 +2,7 @@ name: release
2on: 2on:
3 push: 3 push:
4 branches: 4 branches:
5 - release 5 - release
6 6
7jobs: 7jobs:
8 build-server: 8 build-server:
@@ -11,183 +11,184 @@ jobs:
11 strategy: 11 strategy:
12 matrix: 12 matrix:
13 os: [ubuntu-latest, windows-latest, macos-latest] 13 os: [ubuntu-latest, windows-latest, macos-latest]
14
14 env: 15 env:
15 RUSTFLAGS: -D warnings 16 RUSTFLAGS: -D warnings
16 CARGO_INCREMENTAL: 0 17 CARGO_INCREMENTAL: 0
17 RUSTUP_MAX_RETRIES: 10 18 RUSTUP_MAX_RETRIES: 10
18 CARGO_NET_RETRY: 10 19 CARGO_NET_RETRY: 10
19 steps:
20 20
21 - name: Checkout repository 21 steps:
22 uses: actions/checkout@v1 22 - name: Checkout repository
23 23 uses: actions/checkout@v1
24 # We need to disable the existing toolchain to avoid updating rust-docs 24
25 # which takes a long time. The fastest way to do this is to rename the 25 # We need to disable the existing toolchain to avoid updating rust-docs
26 # existing folder, as deleting it takes about as much time as not doing 26 # which takes a long time. The fastest way to do this is to rename the
27 # anything and just updating rust-docs. 27 # existing folder, as deleting it takes about as much time as not doing
28 - name: Rename existing rust toolchain (Windows) 28 # anything and just updating rust-docs.
29 if: matrix.os == 'windows-latest' 29 - name: Rename existing rust toolchain (Windows)
30 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 30 if: matrix.os == 'windows-latest'
31 31 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
32 - name: Install Rust toolchain 32
33 uses: actions-rs/toolchain@v1 33 - name: Install Rust toolchain
34 with: 34 uses: actions-rs/toolchain@v1
35 toolchain: stable 35 with:
36 profile: minimal 36 toolchain: stable
37 target: x86_64-unknown-linux-musl 37 profile: minimal
38 override: true 38 target: x86_64-unknown-linux-musl
39 39 override: true
40 - name: Build 40
41 if: matrix.os == 'ubuntu-latest' 41 - name: Build
42 uses: actions-rs/cargo@v1 42 if: matrix.os == 'ubuntu-latest'
43 env: 43 uses: actions-rs/cargo@v1
44 CC: clang 44 env:
45 with: 45 CC: clang
46 command: build 46 with:
47 args: --package rust-analyzer --bin rust-analyzer --release --target x86_64-unknown-linux-musl 47 command: build
48 48 args: --package rust-analyzer --bin rust-analyzer --release --target x86_64-unknown-linux-musl
49 - name: Build 49
50 if: matrix.os != 'ubuntu-latest' 50 - name: Build
51 uses: actions-rs/cargo@v1 51 if: matrix.os != 'ubuntu-latest'
52 with: 52 uses: actions-rs/cargo@v1
53 command: build 53 with:
54 args: --package rust-analyzer --bin rust-analyzer --release 54 command: build
55 55 args: --package rust-analyzer --bin rust-analyzer --release
56 - name: Create distribution dir 56
57 run: mkdir ./dist 57 - name: Create distribution dir
58 58 run: mkdir ./dist
59 - name: Copy binary 59
60 if: matrix.os == 'ubuntu-latest' 60 - name: Copy binary
61 run: cp ./target/x86_64-unknown-linux-musl/release/rust-analyzer ./dist/rust-analyzer-linux && strip ./dist/rust-analyzer-linux 61 if: matrix.os == 'ubuntu-latest'
62 62 run: cp ./target/x86_64-unknown-linux-musl/release/rust-analyzer ./dist/rust-analyzer-linux && strip ./dist/rust-analyzer-linux
63 - name: Copy binary 63
64 if: matrix.os == 'macos-latest' 64 - name: Copy binary
65 run: cp ./target/release/rust-analyzer ./dist/rust-analyzer-mac 65 if: matrix.os == 'macos-latest'
66 66 run: cp ./target/release/rust-analyzer ./dist/rust-analyzer-mac
67 - name: Copy binary 67
68 if: matrix.os == 'windows-latest' 68 - name: Copy binary
69 run: copy ./target/release/rust-analyzer.exe ./dist/rust-analyzer-windows.exe 69 if: matrix.os == 'windows-latest'
70 70 run: copy ./target/release/rust-analyzer.exe ./dist/rust-analyzer-windows.exe
71 - name: Upload artifacts 71
72 uses: actions/upload-artifact@v1 72 - name: Upload artifacts
73 with: 73 uses: actions/upload-artifact@v1
74 name: server-${{ matrix.os }} 74 with:
75 path: ./dist 75 name: server-${{ matrix.os }}
76 path: ./dist
76 77
77 build-clients: 78 build-clients:
78 name: build-clients 79 name: build-clients
79 runs-on: ubuntu-latest 80 runs-on: ubuntu-latest
80 steps: 81 steps:
81 - name: Checkout repository 82 - name: Checkout repository
82 uses: actions/checkout@v1 83 uses: actions/checkout@v1
83 84
84 - name: Install Nodejs 85 - name: Install Nodejs
85 uses: actions/setup-node@v1 86 uses: actions/setup-node@v1
86 with: 87 with:
87 node-version: 12.x 88 node-version: 12.x
88 89
89 - run: npm ci 90 - run: npm ci
90 working-directory: ./editors/code 91 working-directory: ./editors/code
91 92
92 - run: npm run package --scripts-prepend-node-path 93 - run: npm run package --scripts-prepend-node-path
93 working-directory: ./editors/code 94 working-directory: ./editors/code
94 95
95 - name: Copy vscode extension 96 - name: Copy vscode extension
96 run: mkdir -p ./dist/code && cp ./editors/code/rust-analyzer.vsix ./dist/ 97 run: mkdir -p ./dist/code && cp ./editors/code/rust-analyzer.vsix ./dist/
97 98
98 - name: Upload artifacts 99 - name: Upload artifacts
99 uses: actions/upload-artifact@v1 100 uses: actions/upload-artifact@v1
100 with: 101 with:
101 name: editor-plugins 102 name: editor-plugins
102 path: ./dist 103 path: ./dist
103 104
104 make-release: 105 make-release:
105 name: make-release 106 name: make-release
106 runs-on: ubuntu-latest 107 runs-on: ubuntu-latest
107 needs: ['build-server', 'build-clients'] 108 needs: ['build-server', 'build-clients']
108 steps: 109 steps:
109 - name: Install Nodejs 110 - name: Install Nodejs
110 uses: actions/setup-node@v1 111 uses: actions/setup-node@v1
111 with: 112 with:
112 node-version: 12.x 113 node-version: 12.x
113 114
114 - run: echo "::set-env name=TAG::$(date --iso)" 115 - run: echo "::set-env name=TAG::$(date --iso)"
115 - run: 'echo "TAG: $TAG"' 116 - run: 'echo "TAG: $TAG"'
116 117
117 - name: Checkout repository 118 - name: Checkout repository
118 uses: actions/checkout@v1 119 uses: actions/checkout@v1
119 120
120 - uses: actions/download-artifact@v1 121 - uses: actions/download-artifact@v1
121 with: 122 with:
122 name: editor-plugins 123 name: editor-plugins
123 path: dist 124 path: dist
124 - uses: actions/download-artifact@v1 125 - uses: actions/download-artifact@v1
125 with: 126 with:
126 name: server-macos-latest 127 name: server-macos-latest
127 path: dist 128 path: dist
128 - uses: actions/download-artifact@v1 129 - uses: actions/download-artifact@v1
129 with: 130 with:
130 name: server-ubuntu-latest 131 name: server-ubuntu-latest
131 path: dist 132 path: dist
132 - uses: actions/download-artifact@v1 133 - uses: actions/download-artifact@v1
133 with: 134 with:
134 name: server-windows-latest 135 name: server-windows-latest
135 path: dist 136 path: dist
136 - run: ls -all ./dist 137 - run: ls -all ./dist
137 138
138 - name: Create Release 139 - name: Create Release
139 id: create_release 140 id: create_release
140 # uses: actions/create-release@v1 141 # uses: actions/create-release@v1
141 # https://github.com/actions/create-release/pull/32 142 # https://github.com/actions/create-release/pull/32
142 uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe 143 uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
143 env: 144 env:
144 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 145 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145 with: 146 with:
146 tag_name: ${{ env.TAG }} 147 tag_name: ${{ env.TAG }}
147 release_name: ${{ env.TAG }} 148 release_name: ${{ env.TAG }}
148 draft: false 149 draft: false
149 prerelease: false 150 prerelease: false
150 151
151 - uses: actions/[email protected] 152 - uses: actions/[email protected]
152 env: 153 env:
153 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 154 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154 with: 155 with:
155 upload_url: ${{ steps.create_release.outputs.upload_url }} 156 upload_url: ${{ steps.create_release.outputs.upload_url }}
156 asset_path: ./dist/rust-analyzer-linux 157 asset_path: ./dist/rust-analyzer-linux
157 asset_name: rust-analyzer-linux 158 asset_name: rust-analyzer-linux
158 asset_content_type: application/octet-stream 159 asset_content_type: application/octet-stream
159 160
160 - uses: actions/[email protected] 161 - uses: actions/[email protected]
161 env: 162 env:
162 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 163 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163 with: 164 with:
164 upload_url: ${{ steps.create_release.outputs.upload_url }} 165 upload_url: ${{ steps.create_release.outputs.upload_url }}
165 asset_path: ./dist/rust-analyzer-mac 166 asset_path: ./dist/rust-analyzer-mac
166 asset_name: rust-analyzer-mac 167 asset_name: rust-analyzer-mac
167 asset_content_type: application/octet-stream 168 asset_content_type: application/octet-stream
168 169
169 - uses: actions/[email protected] 170 - uses: actions/[email protected]
170 env: 171 env:
171 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 172 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172 with: 173 with:
173 upload_url: ${{ steps.create_release.outputs.upload_url }} 174 upload_url: ${{ steps.create_release.outputs.upload_url }}
174 asset_path: ./dist/rust-analyzer-windows.exe 175 asset_path: ./dist/rust-analyzer-windows.exe
175 asset_name: rust-analyzer-windows.exe 176 asset_name: rust-analyzer-windows.exe
176 asset_content_type: application/octet-stream 177 asset_content_type: application/octet-stream
177 178
178 - uses: actions/[email protected] 179 - uses: actions/[email protected]
179 env: 180 env:
180 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 181 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
181 with: 182 with:
182 upload_url: ${{ steps.create_release.outputs.upload_url }} 183 upload_url: ${{ steps.create_release.outputs.upload_url }}
183 asset_path: ./dist/rust-analyzer.vsix 184 asset_path: ./dist/rust-analyzer.vsix
184 asset_name: rust-analyzer.vsix 185 asset_name: rust-analyzer.vsix
185 asset_content_type: application/octet-stream 186 asset_content_type: application/octet-stream
186 187
187 - run: npm ci 188 - run: npm ci
188 working-directory: ./editors/code 189 working-directory: ./editors/code
189 190
190 - name: Publish Extension 191 - name: Publish Extension
191 working-directory: ./editors/code 192 working-directory: ./editors/code
192 # token from https://dev.azure.com/rust-analyzer/ 193 # token from https://dev.azure.com/rust-analyzer/
193 run: npx vsce publish 0.1.$(date +%Y%m%d) --pat ${{ secrets.MARKETPLACE_TOKEN }} 194 run: npx vsce publish 0.1.$(date +%Y%m%d) --pat ${{ secrets.MARKETPLACE_TOKEN }}
diff --git a/.github/workflows/rustdoc.yaml b/.github/workflows/rustdoc.yaml
index caa1dcc30..66c8887ad 100644
--- a/.github/workflows/rustdoc.yaml
+++ b/.github/workflows/rustdoc.yaml
@@ -2,7 +2,7 @@ name: rustdoc
2on: 2on:
3 push: 3 push:
4 branches: 4 branches:
5 - master 5 - master
6 6
7jobs: 7jobs:
8 rustdoc: 8 rustdoc:
@@ -12,28 +12,28 @@ jobs:
12 CARGO_INCREMENTAL: 0 12 CARGO_INCREMENTAL: 0
13 13
14 steps: 14 steps:
15 - name: Checkout repository 15 - name: Checkout repository
16 uses: actions/checkout@v1 16 uses: actions/checkout@v1
17 17
18 - name: Install Rust toolchain 18 - name: Install Rust toolchain
19 uses: actions-rs/toolchain@v1 19 uses: actions-rs/toolchain@v1
20 with: 20 with:
21 toolchain: stable 21 toolchain: stable
22 profile: minimal 22 profile: minimal
23 override: true 23 override: true
24 components: rustfmt, rust-src 24 components: rustfmt, rust-src
25 25
26 - name: Build Documentation 26 - name: Build Documentation
27 uses: actions-rs/cargo@v1 27 uses: actions-rs/cargo@v1
28 with: 28 with:
29 command: doc 29 command: doc
30 args: --all --no-deps 30 args: --all --no-deps
31 31
32 - name: Deploy Docs 32 - name: Deploy Docs
33 uses: peaceiris/[email protected] 33 uses: peaceiris/[email protected]
34 env: 34 env:
35 ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} 35 ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
36 PUBLISH_BRANCH: gh-pages 36 PUBLISH_BRANCH: gh-pages
37 PUBLISH_DIR: ./target/doc 37 PUBLISH_DIR: ./target/doc
38 with: 38 with:
39 forceOrphan: true 39 forceOrphan: true