Skip to content

Commit 04c6043

Browse files
authored
ci: split ci into two files, for push or pr (#5)
1 parent 0ee9342 commit 04c6043

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

.github/workflows/pull-request.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Pull Request Check
2+
3+
on:
4+
pull_request:
5+
branches: [ dev ]
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Cache
19+
uses: actions/cache@v2
20+
with:
21+
path: |
22+
./target
23+
~/.cargo
24+
key: ${{ runner.os }}-${{ hashFiles('Cargo.toml') }}
25+
restore-keys: ${{ runner.os }}
26+
27+
- name: Build
28+
run: cargo build --verbose
29+
30+
- name: Run tests
31+
run: cargo test --verbose

.github/workflows/main.yml renamed to .github/workflows/push.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: Rust
1+
name: Build code, run tests and deploy doc
22

33
on:
44
push:
5-
branches: [ master, dev ]
6-
pull_request:
7-
branches: [ master ]
5+
branches: [ dev ]
86

97
env:
108
CARGO_TERM_COLOR: always
@@ -40,3 +38,4 @@ jobs:
4038
with:
4139
github_token: ${{ secrets.GITHUB_TOKEN }}
4240
publish_dir: ./target/doc
41+
force_orphan: true

0 commit comments

Comments
 (0)