Skip to content

Commit 8670812

Browse files
authored
Merge pull request #2766 from gilescope/windows-build
Upload PR
2 parents 7c1af25 + 2187732 commit 8670812

File tree

3 files changed

+128
-2
lines changed

3 files changed

+128
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
RUN_SLOW_TESTS: 1
2121
RUSTUP_MAX_RETRIES: 10
2222
CARGO_NET_RETRY: 10
23+
PROFILE: debug
2324
steps:
2425

2526
- name: Checkout repository
@@ -75,8 +76,7 @@ jobs:
7576

7677
- name: Prepare cache 2
7778
if: matrix.os == 'windows-latest'
78-
run: Remove-Item ./target/debug/xtask.exe
79-
79+
run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe
8080

8181
type-script:
8282
name: TypeScript

.github/workflows/release.yaml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: CI-Release
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
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

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ debug = 0
88

99
[profile.release]
1010
incremental = true
11+
lto = true
12+
codegen-units = 1
1113
debug = 0 # set this to 1 or 2 to get more useful backtraces in debugger
1214

1315
[patch.'crates-io']

0 commit comments

Comments
 (0)