-
Notifications
You must be signed in to change notification settings - Fork 139
121 lines (99 loc) · 2.91 KB
/
test_ci.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
name: Test
on:
push:
branches:
- '*'
tags-ignore:
- 'v*'
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
strategy:
matrix:
# setup different OS and targets
include:
- name: ubuntu_20_04-x86_64
os: ubuntu-20.04
TARGET_CPU: x86-64
- name: ubuntu_22_04-x86_64
os: ubuntu-22.04
TARGET_CPU: x86-64
- name: osx_11-x86_64
os: macos-11
TARGET_CPU: nehalem
- name: win-x86_64
os: windows-2019
TARGET_CPU: x86-64
- name: ubuntu_20_04-x86_64-haswell
os: ubuntu-20.04
TARGET_CPU: haswell
- name: win-x86_64-haswell
os: windows-2019
TARGET_CPU: haswell
- name: osx_14-aarch64
os: macos-14
TARGET_CPU: apple-m1
- name: ubuntu_24-arm64
os: ubuntu-24-arm-32gb
TARGET_CPU: generic
runs-on: ${{matrix.os}}
steps:
- run: rustup show
- name: Checkout code
uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
### Cargo Cache for Build Artifacts ###
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{matrix.name}}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install NASM
uses: ./.github/actions/install-nasm
### Check Build ###
- name: Check Build
run: cargo check --all
### Test Code ###
- name: Test Build
run: cargo test --all
env:
RUSTFLAGS: -C target-cpu=${{matrix.TARGET_CPU}}
### Build the code ###
- name: Build Release
run: cargo build --all
shell: bash
env:
RUSTFLAGS: -C target-cpu=${{matrix.TARGET_CPU}}
test_win32:
runs-on: windows-2019
steps:
- run: rustup show
- name: Checkout code
uses: actions/checkout@v3
### Install Nasm with fallback to S3 ###
- name: Install nasm
uses: ./.github/actions/install-nasm
### Cargo cache for Build artifacts ###
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-windows-test-32-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install latest 32bit target
uses: dtolnay/rust-toolchain@stable
with:
#components: rustfmt, clippy
target: i686-pc-windows-msvc
### check and test build ###
- name: Check Build
run: cargo check --all --target=i686-pc-windows-msvc
- name: Test Build
run: cargo test --all --release --target=i686-pc-windows-msvc