-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (67 loc) · 2.01 KB
/
CICD.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
release_matrix:
strategy:
matrix:
release: [stable, beta, nightly]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.release }}
profile: minimal
components: clippy, rustfmt
override: true
- name: Check Rust toolchain
run: make toolchain
- name: Format
run: make format
- name: Lint
run: make lint
- name: Test
run: make test
- name: Binary Release
run: make release
# Uncomment the following lines to build and deploy Docker image
# - name: Lint Dockerfile
# uses: hadolint/hadolint@v2
# with:
# files: Dockerfile
# level: error
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Log in to GitHub container registry
# uses: docker/login-action@v1
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ github.token }}
# - name: Lowercase the repo name and username
# run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
# - name: Build and push container image to registry
# uses: docker/build-push-action@v2
# with:
# push: true
# tags: ghcr.io/${{ env.REPO }}:${{ github.sha }}
# file: ./Dockerfile
# Build status badge
- name: Build status badge
uses: RubbaBoy/[email protected]
with:
NAME: ${{ matrix.release }}
LABEL: ${{ matrix.release }}
STATUS: ${{ job.status }}
COLOR: ${{ job.status == 'success' && 'green' || job.status == 'failure' && 'red' || 'yellow' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}