-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathci.yml
64 lines (52 loc) · 1.5 KB
/
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
# .github/workflows/ci.yml
name: CI
# Run this workflow on pushes to the main branch and on pull requests
on:
push:
branches:
- main
pull_request:
branches:
- main
# Define the jobs to be run
jobs:
build:
# Define the job environment
runs-on: ubuntu-latest
# Steps to be executed
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v2
# Set up Rust environment
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
# Cache the Cargo registry to speed up the build process
- name: Cache Cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
# Cache the Cargo build directory to speed up the build process
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
# Install dependencies
- name: Install dependencies
run: cargo build --release
# Run tests
- name: Run tests
run: cargo test --verbose
# Build the project
- name: Build project
run: cargo build --release