-
Notifications
You must be signed in to change notification settings - Fork 9
172 lines (161 loc) · 5.36 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# This file is based on https://github.com/rust-lang/rustfmt/blob/master/.github/workflows/windows.yml
# rustfmt is licensed in MIT Copyright (c) 2016-2021 The Rust Project Developers https://github.com/rust-lang/rustfmt/blob/master/LICENSE-MIT
name: Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "true"
jobs:
build:
runs-on: windows-latest
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
fail-fast: false
matrix:
target: [
i686-pc-windows-msvc,
x86_64-pc-windows-msvc,
i686-pc-windows-gnu,
x86_64-pc-windows-gnu,
]
cfg_release_channel: [stable]
steps:
# The Windows runners have autocrlf enabled by default
# which causes failures for some of rustfmt's line-ending sensitive tests
- name: disable git eol translation
run: git config --global core.autocrlf false
- name: checkout
uses: actions/checkout@v3
# Run build
- name: Install Rustup using win.rustup.rs
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
del rustup-init.exe
rustup target add ${{ matrix.target }}
shell: powershell
- name: Run sccache-cache
uses: Xuanwo/sccache-action@c94e27bef21ab3fb4a5152c8a878c53262b4abb0
with:
version: "v0.4.0-pre.6"
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
key: rust-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}-${{ steps.get-date.outputs.date }}-build
restore-keys: |
rust-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}
rust-${{ runner.os }}
- name: build
run: |
rustc -Vv
cargo -V
cd fire_seq_search_server
cargo build
shell: cmd
- name: test
run: |
cd fire_seq_search_server
cargo test
shell: cmd
- name: Package
run: |
cd fire_seq_search_server
cargo package --verbose
shell: cmd
- name: Run sccache stat for check
shell: bash
run: ${SCCACHE_PATH} --show-stats
release:
needs: build
runs-on: windows-latest
name: Build for (${{ matrix.target }} with ${{ matrix.cfg_release_channel }})
env:
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
strategy:
fail-fast: false
matrix:
target: [
i686-pc-windows-msvc,
x86_64-pc-windows-msvc,
]
cfg_release_channel: [ stable ]
steps:
- name: disable git eol translation
run: git config --global core.autocrlf false
- name: checkout
uses: actions/checkout@v3
- name: Install Rustup using win.rustup.rs
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
del rustup-init.exe
rustup target add ${{ matrix.target }}
shell: powershell
- name: Run sccache-cache
uses: Xuanwo/sccache-action@c94e27bef21ab3fb4a5152c8a878c53262b4abb0
with:
version: "v0.4.0-pre.6"
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache cargo registry and sccache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
key: rust-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}-${{ steps.get-date.outputs.date }}-build
restore-keys: |
rust-${{ runner.os }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}
rust-${{ runner.os }}
- name: build
run: |
rustc -Vv
cargo -V
cd fire_seq_search_server
cargo build --release
shell: cmd
- name: test
run: |
cd fire_seq_search_server
cargo test
shell: cmd
- name: Package
run: |
cd fire_seq_search_server
cargo package --verbose
shell: cmd
- name: Save Artifact
run: |
mkdir builds
mv fire_seq_search_server/target/debug/fire_seq_search_server.exe builds
shell: cmd
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: logseq-${{ runner.os }}-builds
path: builds
- name: Run sccache stat for check
shell: bash
run: ${SCCACHE_PATH} --show-stats