Skip to content

Commit 6cd8a66

Browse files
author
fbrv
committed
add ci jobs
1 parent 5041f16 commit 6cd8a66

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
branches:
8+
- main
9+
- '**'
10+
11+
jobs:
12+
rustfmt:
13+
name: Format
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout sources
17+
uses: actions/checkout@v2
18+
19+
- name: Install nightly toolchain with rustfmt available
20+
uses: actions-rs/toolchain@v1
21+
with:
22+
profile: minimal
23+
toolchain: nightly
24+
override: true
25+
components: rustfmt
26+
27+
- name: Run cargo fmt
28+
uses: actions-rs/cargo@v1
29+
continue-on-error: true # WARNING: only for this example, remove it!
30+
with:
31+
command: fmt
32+
args: --all -- --check
33+
34+
clippy:
35+
name: Lint
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout sources
39+
uses: actions/checkout@v2
40+
41+
- name: Install stable toolchain with clippy available
42+
uses: actions-rs/toolchain@v1
43+
with:
44+
profile: minimal
45+
toolchain: stable
46+
override: true
47+
components: clippy
48+
49+
- name: Run cargo clippy
50+
uses: actions-rs/cargo@v1
51+
with:
52+
command: clippy
53+
args: --all -- -D warnings
54+
tests:
55+
name: Test
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout sources
59+
uses: actions/checkout@v2
60+
- name: Install stable toolchain
61+
uses: actions-rs/toolchain@v1
62+
with:
63+
profile: minimal
64+
toolchain: stable
65+
override: true
66+
- name: Run tests
67+
uses: actions-rs/cargo@v1
68+
with:
69+
command: test
70+
args: --all --verbose
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy Images to GHCR
2+
3+
4+
on:
5+
push:
6+
branches: ['**']
7+
pull_request:
8+
branches:
9+
- main
10+
- '**'
11+
12+
jobs:
13+
push-store-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: 'Checkout GitHub Action'
17+
uses: actions/checkout@main
18+
19+
- name: 'Login to GitHub Container Registry'
20+
uses: docker/login-action@v1
21+
with:
22+
registry: ghcr.io
23+
username: ${{github.actor}}
24+
password: ${{secrets.GITHUB_TOKEN}}
25+
26+
- name: 'Build pbs image'
27+
run: |
28+
docker build --tag ghcr.io/commit-boost/commit-boost-client/pbs:latest -f docker/pbs.Dockerfile .
29+
docker push ghcr.io/commit-boost/commit-boost-client/pbs:latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Cargo.lock
1717
*.docker-compose.yml
1818
targets.json
1919

20+
.idea/

0 commit comments

Comments
 (0)