]> git.lizzy.rs Git - rust.git/blob - .github/workflows/main.yml
Setup github actions
[rust.git] / .github / workflows / main.yml
1 name: CI
2
3 on:
4   - push
5   - pull_request
6
7 jobs:
8   build:
9     runs-on: ${{ matrix.os }}
10
11     strategy:
12       fail-fast: false
13       matrix:
14         os: [ubuntu-latest, macos-latest]
15
16     steps:
17     - uses: actions/checkout@v2
18     
19     - name: Cache cargo installed crates
20       uses: actions/cache@v1.1.2
21       with:
22         path: $HOME/.cargo/bin
23         key: cargo-installed-crates
24
25     - name: Prepare dependencies
26       run: |
27         git config --global user.email "user@example.com"
28         git config --global user.name "User"
29         ./prepare.sh
30     
31     # Compile is a separate step, as the actions-rs/cargo action supports error annotations
32     - name: Compile
33       uses: actions-rs/cargo@v1.0.1
34       with:
35         command: build
36         args: --release
37     
38     - name: Test
39       run: |
40         # Enable backtraces for easier debugging
41         export RUST_BACKTRACE=1
42         
43         # Reduce amount of benchmark runs as they are slow
44         export COMPILE_RUNS=2
45         export RUN_RUNS=2
46         
47         ./test.sh --release