This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (74 loc) · 2.31 KB
/
ci.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
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0
---
name: "CI"
on:
pull_request:
push:
branches:
- "main"
tags:
- "v*.*.*"
schedule:
- cron: '0 0 * * *'
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
jobs:
lint:
name: "Lint"
runs-on: "ubuntu-22.04"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v3"
- name: "Prepare the job environment."
uses: "./.github/workflows/prepare-action"
- name: "Lint code."
run: "poetry run molecule lint"
license_compliance:
name: "Check license compliance with reuse."
runs-on: "ubuntu-22.04"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v3"
- name: "Prepare the job environment."
uses: "./.github/workflows/prepare-action"
- name: "Lint code."
run: "poetry run reuse lint"
test:
name: "Run Molecule tests."
runs-on: "ubuntu-22.04"
strategy:
fail-fast: true
matrix:
image:
- "ghcr.io/hifis-net/ubuntu-systemd:20.04"
- "ghcr.io/hifis-net/ubuntu-systemd:22.04"
steps:
- name: "Check out the codebase."
uses: "actions/checkout@v3"
- name: "Enable lingering required for podman and systemd in GH Actions."
run: | # Compare with https://github.com/eriksjolund/user-systemd-service-actions-workflow/blob/efe872924fd2dd35bb482544126ce751303e14c2/README.md
sudo loginctl enable-linger $UID
sleep 1
- name: "Prepare the job environment."
uses: "./.github/workflows/prepare-action"
- name: "Run Molecule tests."
run: "XDG_RUNTIME_DIR=/run/user/$UID poetry run molecule test"
env:
MOLECULE_IMAGE: "${{ matrix.image }}"
release:
name: "Release new version on Ansible Galaxy"
runs-on: "ubuntu-22.04"
if: "startsWith(github.ref, 'refs/tags/v')"
needs: ["lint", "license_compliance", "test"]
steps:
- name: "checkout"
uses: "actions/checkout@v3"
- name: "galaxy"
uses: "robertdebock/[email protected]"
with:
galaxy_api_key: "${{ secrets.galaxy_api_key }}"
git_branch: "main"