-
Notifications
You must be signed in to change notification settings - Fork 3
113 lines (97 loc) · 3.38 KB
/
pr_cockpit.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
108
109
110
111
112
113
---
name: Pull Request Cockpit
on:
pull_request:
paths:
- ".github/workflows/pr_cockpit.yml"
- "rust/stackable-cockpitd"
- "rust/stackable-cockpit"
- "docs/modules/cockpit"
- "docs/modules/ROOT"
- "Cargo.lock"
- "deploy"
- "docker"
- "go.sum"
env:
RUST_VERSION: 1.73.0
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
RUST_LOG: "info"
DEV_REPO_HELM_URL: https://repo.stackable.tech/repository/helm-dev
jobs:
general-checks:
name: General Pull Request Checks
uses: ./.github/workflows/pr_general.yml
reviewdog-checks:
name: Reviewdog Pull Request Checks
uses: ./.github/workflows/pr_reviewdog.yml
check-charts:
name: Helm Chart Check
runs-on: ubuntu-latest
needs:
- general-checks
- reviewdog-checks
steps:
- name: Checkout Repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
submodules: recursive
- name: Setup Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.6.2
- name: Setup Rust
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # v1
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
with:
key: pr-stackable-cockpit-chart
- name: Regenerate Charts
run: make regenerate-charts
- name: Checking that Helm Charts are up-to-date
run: git diff --exit-code
- name: Helm Charts not up-to-date
if: ${{ failure() }}
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6
with:
script: |
core.setFailed('Committed Helm charts were not up to date, please regenerate and re-commit!')
publish:
name: Publish Docker Image
runs-on: ubuntu-latest
env:
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
outputs:
IMAGE_TAG: ${{ steps.printtag.outputs.IMAGE_TAG }}
needs:
- check-charts
steps:
- name: Checkout Repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
submodules: recursive
- name: Setup Rust
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # v1
with:
toolchain: ${{ env.RUST_VERSION }}
- name: Setup Rust Cache
uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
with:
key: pr-stackable-cockpit-chart
- name: Update Version
run: |
cargo install cargo-edit --version 0.11.11
cargo set-version --offline --package stackable-cockpit 0.0.0-pr${{ github.event.pull_request.number }}
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
# This is needed for the HELM_REPO variable.
- name: Publish Docker Image and Helm Chart
run: make -e publish
- id: printtag
name: Output Image Name and Tag
run: echo "IMAGE_TAG=$(make -e print-docker-tag)" >> "$GITHUB_OUTPUT"