-
Notifications
You must be signed in to change notification settings - Fork 3
149 lines (146 loc) · 4.9 KB
/
ci.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: "Price Feeder & Alarms Dispatcher CI"
on:
workflow_dispatch:
push:
branches:
- "main"
tags:
- "*"
pull_request:
branches:
- "main"
paths-ignore:
- "README.md"
permissions:
packages: "write"
jobs:
check_formatting:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "nolus-protocol/rust-ci-actions/rust_cache@main"
with:
update_and_cache_toolchains: "true"
- uses: "nolus-protocol/rust-ci-actions/check_formatting@main"
check_codebase:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "nolus-protocol/rust-ci-actions/rust_cache@main"
with:
update_and_cache_toolchains: "true"
- uses: "nolus-protocol/rust-ci-actions/check_codebase@main"
# audit_dependencies:
# runs-on: "ubuntu-latest"
# steps:
# - uses: "actions/checkout@v4"
# - uses: "nolus-protocol/rust-ci-actions/rust_cache@main"
# with:
# update_and_cache_toolchains: "true"
# - uses: "nolus-protocol/rust-ci-actions/audit_dependencies@main"
linting:
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v4"
- uses: "nolus-protocol/rust-ci-actions/rust_cache@main"
with:
update_and_cache_toolchains: "true"
- name: "Run clippy"
shell: "sh"
run: "cargo clippy -- -F unsafe_code -D warnings"
code_coverage:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "nolus-protocol/rust-ci-actions/rust_cache@main"
with:
update_and_cache_toolchains: "true"
- uses: "nolus-protocol/rust-ci-actions/code_coverage@main"
test_release_profile:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "nolus-protocol/rust-ci-actions/rust_cache@main"
with:
update_and_cache_toolchains: "true"
- name: "Run tests in release profile"
shell: "sh"
run: "cargo test --release"
build:
runs-on: "ubuntu-latest"
needs:
- "check_formatting"
- "check_codebase"
# - "audit_dependencies"
- "linting"
- "code_coverage"
- "test_release_profile"
if: "github.ref_type == 'tag'"
steps:
- uses: "actions/checkout@v4"
- name: "Build compiling image"
shell: "sh"
run: "docker build --rm -f Compile.Dockerfile -t compile ."
- name: "Compile binaries"
shell: "sh"
run: 'docker run -v "$(pwd):/code/" -v "$(pwd)/artifacts/:/artifacts/" --name compile compile'
- name: "Archive Alpine Linux feeder binary artifact"
uses: "actions/upload-artifact@v4"
with:
name: "alpine-linux-feeder"
path: "artifacts/feeder"
- name: "Archive Alpine Linux alarms dispatcher binary artifact"
uses: "actions/upload-artifact@v4"
with:
name: "alpine-linux-alarms-dispatcher"
path: "artifacts/alarms-dispatcher"
- name: "Build pre-configured Docker images for dev-net"
if: "github.ref_type == 'tag' || ${{ github.event_name }} == 'workflow_dispatch'"
uses: "./.github/actions/preconfigured_images"
with:
config: "dev"
github_token: "${{ secrets.GITHUB_TOKEN }}"
docker_registry: "ghcr.io"
docker_repository: "nolus-protocol"
docker_tag: "${{ github.ref_name }}"
- name: "Build pre-configured Docker images for test-net"
if: "github.ref_type == 'tag'"
uses: "./.github/actions/preconfigured_images"
with:
config: "test"
github_token: "${{ secrets.GITHUB_TOKEN }}"
docker_registry: "ghcr.io"
docker_repository: "nolus-protocol"
docker_tag: "${{ github.ref_name }}"
- name: "Build pre-configured Docker images for main-net"
if: "github.ref_type == 'tag'"
uses: "./.github/actions/preconfigured_images"
with:
config: "main"
github_token: "${{ secrets.GITHUB_TOKEN }}"
docker_registry: "ghcr.io"
docker_repository: "nolus-protocol"
docker_tag: "${{ github.ref_name }}"
release:
name: "draft_release"
runs-on: "ubuntu-latest"
needs:
- "build"
permissions: "write-all"
if: "github.ref_type == 'tag'"
steps:
- uses: "actions/checkout@v4"
- name: "Download artifacts"
uses: "actions/download-artifact@v4"
- name: "Display structure of downloaded files"
run: "ls -R"
# temporary using commit as version until it is merged. Updates node version v12 -> v16
- uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
files: |
alpine-linux-alarms-dispatcher
alpine-linux-feeder
./configurations/