-
Notifications
You must be signed in to change notification settings - Fork 8
54 lines (48 loc) · 1.51 KB
/
main.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
name: main
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
SCCACHE_REGION: us-east-1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Format
env:
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
SCCACHE_AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_AWS_ACCESS_KEY_ID }}
SCCACHE_AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
run: |
docker run \
--rm \
--tty \
--volume "$PWD:/code" \
--workdir /code \
--env SCCACHE_REGION \
--env SCCACHE_BUCKET \
--env SCCACHE_AWS_SECRET_ACCESS_KEY \
--env SCCACHE_AWS_ACCESS_KEY_ID \
scoots/rust-con-sccache:latest \
cargo fmt --all -- --check --verbose
- name: Test
env:
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
SCCACHE_AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_AWS_ACCESS_KEY_ID }}
SCCACHE_AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
run: |
docker run \
--rm \
--tty \
--volume "$PWD:/code" \
--workdir /code \
--env SCCACHE_REGION \
--env SCCACHE_BUCKET \
--env SCCACHE_AWS_SECRET_ACCESS_KEY \
--env SCCACHE_AWS_ACCESS_KEY_ID \
scoots/rust-con-sccache:latest \
bash -c 'cargo test --verbose --all && sccache-wrapper.sh --show-stats'