-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (103 loc) · 2.65 KB
/
build.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CLI Pipeline
on:
push:
branches-ignore:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
HUSKY: 0
RUST_TOOLCHAIN: stable
TOOLCHAIN_PROFILE: minimal
jobs:
build:
name: 'Rust Build'
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: ${{ env.TOOLCHAIN_PROFILE }}
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
components: rustfmt, clippy
- name: Use Cache
uses: Swatinem/rust-cache@v2
- name: cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
# args: -- -D warnings
- name: Unit- and Integration-Tests
uses: actions-rs/cargo@v1
env:
RUST_TEST_THREADS: 1
with:
command: test
- name: Build Binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --verbose
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: cli
path: target/release/propeller
test:
name: 'Integration Test CLI'
needs: build
runs-on: ubuntu-latest
services:
vault:
image: hashicorp/vault:1.17.1
ports:
- 8200:8200
options: --cap-add=IPC_LOCK
env:
VAULT_DEV_ROOT_TOKEN_ID: 'root-token'
steps:
- name: Check out code
uses: actions/checkout@v4
with:
name: cli
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: 'npm'
- name: Install node.js packages
run: npm ci
- name: Wait for Vault
run: npm run ci:wait-for-vault
- name: Download Binary
uses: actions/download-artifact@v4
- name: Run integration tests
run: |
chmod 755 ./cli/propeller
./cli/propeller init-vault -c dev/config.yml
env:
VAULT_TOKEN: 'root-token'
check:
name: 'Resources Validation'
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: 'npm'
- name: Install node.js packages
run: npm ci
- name: Check Format of Resources
run: npm run prettier:format