-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
90 lines (77 loc) · 2.53 KB
/
Copy pathcore_tests.yml
File metadata and controls
90 lines (77 loc) · 2.53 KB
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
name: Core Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
jobs:
test:
strategy:
fail-fast: false
matrix:
settings:
- host: [self-hosted, macOS, ARM64]
target: aarch64-apple-darwin
os: macos
- host: ubuntu-22.04
target: x86_64-unknown-linux-gnu
os: linux
- host: [self-hosted, Windows, X64]
target: x86_64-pc-windows-msvc
os: windows
name: Test Core - ${{ matrix.settings.os }}
runs-on: ${{ matrix.settings.host }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Maximize build space
if: ${{ matrix.settings.os == 'linux' }}
uses: easimon/maximize-build-space@master
with:
swap-size-mb: 3072
root-reserve-mb: 6144
remove-dotnet: "true"
remove-codeql: "true"
remove-haskell: "true"
remove-docker-images: "true"
- name: Symlink target to C:\
if: ${{ matrix.settings.os == 'windows' }}
shell: cmd
run: |
if exist target rmdir /S /Q target
if not exist C:\spacedrive_target mkdir C:\spacedrive_target
mklink /J target C:\spacedrive_target
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.target }}
- name: Setup System and Rust
uses: ./.github/actions/setup-system
with:
token: ${{ secrets.GITHUB_TOKEN }}
target: ${{ matrix.settings.target }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ matrix.settings.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ matrix.settings.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ matrix.settings.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Setup native dependencies
run: cargo run -p xtask -- setup
- name: Run all tests
run: cargo run -p xtask -- test-core --verbose