This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
85 lines (85 loc) · 2.38 KB
/
cargo-build.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
on:
push:
paths:
- '**.rs'
- '*/Cargo.toml'
- 'Cargo.lock'
- .github/workflows/cargo-build.yml
- rust-toolchain.toml
pull_request:
paths:
- '**.rs'
- '*/Cargo.toml'
- 'Cargo.lock'
- .github/workflows/cargo-build.yml
- rust-toolchain.toml
name: cargo build
jobs:
cargobuild:
name: cargo build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Cleanup unused space
shell: bash
run: |
set -x
df -h /
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/microsoft
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/lib/jvm
sudo rm -rf /usr/local/graalvm
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/share/swift
df -h /
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Install latest nightly
uses: oxidecomputer/actions-rs_toolchain@oxide/master
with:
components: rustfmt, clippy
- name: Install libusb
shell: bash
run: |
sudo apt update -y && sudo apt install -y \
libusb-1.0-0-dev
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ github.ref }}
restore-keys: |
${{ runner.os }}-cargo-registry-${{ github.ref }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ github.ref }}
restore-keys: |
${{ runner.os }}-cargo-index-${{ github.ref }}
- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ github.ref }}
restore-keys: |
${{ runner.os }}-cargo-build-target-${{ github.ref }}
- name: Report pre-build remaining disk
shell: bash
run: |
set -x
df -h /
- name: Run cargo build
run: |
cargo build
shell: bash
- name: Report remaining disk
shell: bash
run: |
set -x
df -h /