-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.26 KB
/
rs.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
name: Rust CI
on:
push:
branches: [ main ]
paths: [ rs/** ]
pull_request:
branches: [ main ]
paths: [ rs/** ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Day
id: get-day
run: echo "::set-output name=day::$(seq 1 $(expr '(' $(date +%s) - $(TZ=UTC+5 date +%s --date=2020-12-01) ')' / 86400 + 1) | head -n25 | tail -n1)"
- uses: actions/cache@v2
with:
key: inputs-${{ steps.get-day.outputs.day }}
restore-keys: inputs-
path: day*.txt
- name: Get inputs
run: make
env:
SESSION: ${{ secrets.SESSION }}
- id: rust-toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- uses: actions/cache@v2
with:
key: ${{ runner.os }}-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.*') }}
restore-keys: ${{ runner.os }}-${{ steps.rust-toolchain.outputs.rustc_hash }}-
path: ~/.cargo
- name: Run cargo test
run: |
cargo build --all-features --all-targets --release
cargo test --release
working-directory: rs