Repository navigation
105 lines (90 loc) · 3.14 KB
/
Copy pathmain.yaml
File metadata and controls
105 lines (90 loc) · 3.14 KB
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
name: Continuous integration
on:
push:
branches:
- master
- '[0-9]+.[0-9]+'
tags:
- '*'
pull_request:
permissions:
actions: write
contents: write
packages: write
id-token: write
env:
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}
jobs:
main:
name: Continuous integration
runs-on: ubuntu-26.04
timeout-minutes: 20
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"
concurrency: main
steps:
- run: docker system prune --all --force
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
- run: python3 -m pip install --requirement=ci/requirements.txt
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files --color=always
env:
SKIP: poetry-lock,helm-lock
- run: git diff --exit-code --patch > /tmp/pre-commit.patch; git diff --color; git reset --hard || true
if: failure()
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Apply pre-commit fix.patch
path: /tmp/pre-commit.patch
retention-days: 1
if: failure()
- name: Print environment information
run: c2cciutils-env
- name: Build
run: make build
- name: Lint
run: make prospector
- name: Install helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: 4.3.0
- run: helm lint .
- name: Setup k3s/k3d
run: c2cciutils-k8s-install
- name: Import my image
run: k3d image import ghcr.io/camptocamp/github-webhook-operator:latest --cluster=test-cluster
- run: make tests
- run: c2cciutils-k8s-logs
if: always()
- name: Publish
run: tag-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: env.HAS_SECRETS == 'HAS_SECRETS'
- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch; git diff --color; git reset --hard ||
true
if: failure()
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Update dpkg versions list.patch
path: /tmp/dpkg-versions.patch
retention-days: 1
if: failure()
- name: Trigger changelog workflow
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |-
if (process.env.GITHUB_REF_TYPE == 'tag') {
console.log('Trigger changelog');
await github.rest.repos.createDispatchEvent({
owner: 'camptocamp',
repo: 'operator-github-webhook',
event_type: 'changelog',
});
}