aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci.yaml4
-rw-r--r--.github/workflows/release.yaml124
-rw-r--r--Cargo.toml2
3 files changed, 128 insertions, 2 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index e7e0d599e..3a2bdb4a6 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -20,6 +20,7 @@ jobs:
20 RUN_SLOW_TESTS: 1 20 RUN_SLOW_TESTS: 1
21 RUSTUP_MAX_RETRIES: 10 21 RUSTUP_MAX_RETRIES: 10
22 CARGO_NET_RETRY: 10 22 CARGO_NET_RETRY: 10
23 PROFILE: debug
23 steps: 24 steps:
24 25
25 - name: Checkout repository 26 - name: Checkout repository
@@ -75,8 +76,7 @@ jobs:
75 76
76 - name: Prepare cache 2 77 - name: Prepare cache 2
77 if: matrix.os == 'windows-latest' 78 if: matrix.os == 'windows-latest'
78 run: Remove-Item ./target/debug/xtask.exe 79 run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe
79
80 80
81 type-script: 81 type-script:
82 name: TypeScript 82 name: TypeScript
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 000000000..6cb27482d
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,124 @@
1name: CI-Release
2on:
3 pull_request:
4 push:
5 branches:
6 - master
7
8jobs:
9 rust:
10 name: Rust
11 runs-on: ${{ matrix.os }}
12 strategy:
13 matrix:
14 os: [ubuntu-latest, windows-latest, macos-latest]
15 env:
16 RUSTFLAGS: -D warnings
17 CARGO_INCREMENTAL: 0
18 RUN_SLOW_TESTS: 1
19 RUSTUP_MAX_RETRIES: 10
20 CARGO_NET_RETRY: 10
21 PROFILE: release
22 steps:
23
24 - name: Checkout repository
25 uses: actions/checkout@v1
26
27 # We need to disable the existing toolchain to avoid updating rust-docs
28 # which takes a long time. The fastest way to do this is to rename the
29 # existing folder, as deleting it takes about as much time as not doing
30 # anything and just updating rust-docs.
31 - name: Rename existing rust toolchain (Windows)
32 if: matrix.os == 'windows-latest'
33 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
34
35 - name: Install Rust toolchain
36 uses: actions-rs/toolchain@v1
37 with:
38 toolchain: stable
39 profile: minimal
40 override: true
41 components: rustfmt, rust-src
42
43 - name: Cache cargo registry
44 uses: actions/cache@v1
45 with:
46 path: ~/.cargo/registry
47 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
48
49 - name: Cache cargo index
50 uses: actions/cache@v1
51 with:
52 path: ~/.cargo/git
53 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
54
55 - name: Cache cargo target dir
56 uses: actions/cache@v1
57 with:
58 path: target
59 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
60
61 - name: Compile and Test
62 uses: actions-rs/cargo@v1
63 with:
64 command: test
65 args: --release --all-targets
66
67 - name: Prepare cache
68 run: cargo xtask pre-cache
69
70 - name: Prepare cache 2
71 if: matrix.os == 'windows-latest'
72 run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe
73
74 - name: Creat distribution dir
75 run: mkdir ./dist
76
77 - name: Copy binaries (non-win)
78 if: matrix.os != 'windows-latest'
79 run: cp ./target/${{ env.PROFILE }}/ra_lsp_server ./dist
80
81 - name: Copy binaries (win)
82 if: matrix.os == 'windows-latest'
83 run: copy ./target/${{ env.PROFILE }}/ra_lsp_server.* ./dist
84
85 - name: Upload artifacts
86 uses: actions/upload-artifact@v1
87 with:
88 name: server-${{ matrix.os }}
89 path: ./dist
90
91 type-script:
92 name: TypeScript
93 runs-on: ubuntu-latest
94 env:
95 CXX: g++-4.9
96 CC: gcc-4.9
97 steps:
98 - name: Checkout repository
99 uses: actions/checkout@v1
100
101 - name: Install Nodejs
102 uses: actions/setup-node@v1
103 with:
104 node-version: 12.x
105
106 - run: npm ci
107 working-directory: ./editors/code
108 - run: npm run package --scripts-prepend-node-path
109 working-directory: ./editors/code
110
111 - name: Create distribution directory
112 run: mkdir ./dist
113
114 - name: Copy vscode extension
115 run: mkdir ./dist/code && cp ./editors/code/*.vsix ./dist/code/
116
117 - name: Copy emacs mode
118 run: cp -R ./editors/emacs ./dist/
119
120 - name: Upload artifacts
121 uses: actions/upload-artifact@v1
122 with:
123 name: editors
124 path: ./dist
diff --git a/Cargo.toml b/Cargo.toml
index 97508c57b..3753a4143 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,6 +8,8 @@ debug = 0
8 8
9[profile.release] 9[profile.release]
10incremental = true 10incremental = true
11lto = true
12codegen-units = 1
11debug = 0 # set this to 1 or 2 to get more useful backtraces in debugger 13debug = 0 # set this to 1 or 2 to get more useful backtraces in debugger
12 14
13[patch.'crates-io'] 15[patch.'crates-io']