Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit e288975

Browse files
author
Norman Ziegner
authored
Merge pull request #2 from hifis-net/github-actions
Implement CI pipeline via GitHub Actions
2 parents e669550 + c35a02a commit e288975

6 files changed

Lines changed: 126 additions & 100 deletions

File tree

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
2+
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
version: 2
7+
updates:
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
# Check for updates to GitHub Actions every weekday
13+
interval: "daily"
14+
15+
- package-ecosystem: "pip"
16+
directory: "/"
17+
schedule:
18+
# Check for updates to pip packages every weekday
19+
interval: "daily"
20+
ignore:
21+
- dependency-name: "python"
22+
update-types: ["version-update:semver-major"]

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
2+
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
---
7+
name: CI
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- "main"
13+
tags:
14+
- "v*.*.*"
15+
schedule:
16+
- cron: '0 2 * * *'
17+
18+
env:
19+
PY_COLORS: 1
20+
ANSIBLE_FORCE_COLOR: 1
21+
22+
jobs:
23+
24+
lint:
25+
name: Lint
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Check out the codebase.
29+
uses: actions/checkout@v3
30+
31+
- name: Prepare the job environment.
32+
uses: ./.github/workflows/prepare-action
33+
34+
- name: Lint code.
35+
run: pipenv run molecule lint
36+
37+
license_compliance:
38+
name: Check license compliance with reuse.
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Check out the codebase.
42+
uses: actions/checkout@v3
43+
44+
- name: Prepare the job environment.
45+
uses: ./.github/workflows/prepare-action
46+
47+
- name: Lint code.
48+
run: pipenv run reuse lint
49+
50+
test:
51+
name: Run Molecule tests.
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Check out the codebase.
56+
uses: actions/checkout@v3
57+
58+
- name: Prepare the job environment.
59+
uses: ./.github/workflows/prepare-action
60+
61+
- name: Run Molecule tests.
62+
run: pipenv run molecule test
63+
64+
release:
65+
name: Release new version on Ansible Galaxy
66+
runs-on: ubuntu-latest
67+
if: startsWith(github.ref, 'refs/tags/v')
68+
needs: [lint, license_compliance, test]
69+
steps:
70+
- name: checkout
71+
uses: actions/checkout@v3
72+
- name: galaxy
73+
uses: robertdebock/galaxy-action@1.2.0
74+
with:
75+
galaxy_api_key: ${{ secrets.galaxy_api_key }}
76+
git_branch: "main"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
2+
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
---
7+
name: Install dependencies and prepare the environment.
8+
description: Install the necessary dependencies for jobs.
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Install pipenv.
13+
run: pipx install pipenv
14+
shell: bash
15+
16+
- name: Set up Python 3.
17+
uses: actions/setup-python@v3
18+
id: setup-python
19+
with:
20+
python-version: '3.9'
21+
cache: 'pipenv'
22+
23+
- name: Install dependencies via pipenv.
24+
run: pipenv install --dev
25+
shell: bash

.github/workflows/release.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.gitlab-ci.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Group your changes into these categories:
2222

2323
### Changed
2424

25+
- Implement CI pipeline via GitHub Actions
26+
([\#2](https://github.com/hifis-net/ansible-role-redis/pull/2)
27+
by [tobiashuste](https://github.com/tobiashuste)).
2528
- Update Python dependencies and use Python 3.9 in GitLab CI
2629
([!47](https://gitlab.com/hifis/ansible/redis-role/-/merge_requests/47)
2730
by [tobiashuste](https://gitlab.com/tobiashuste)).

0 commit comments

Comments
 (0)