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

Commit

Permalink
Migrate from GitLab CI/CD to GitHub actions
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Ziegner <[email protected]>
  • Loading branch information
Norman Ziegner authored and tobiashuste committed Apr 8, 2022
1 parent 7f7914b commit a0933cd
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 102 deletions.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"

- package-ecosystem: "pip"
directory: "/"
schedule:
# Check for updates to pip packages every weekday
interval: "daily"
ignore:
- dependency-name: "python"
update-types: ["version-update:semver-major"]
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Prepare the job environment.
uses: ./.github/workflows/prepare-action

- name: Lint code.
run: pipenv run molecule lint

license_compliance:
name: Check license compliance with reuse.
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Prepare the job environment.
uses: ./.github/workflows/prepare-action

- name: Lint code.
run: pipenv run reuse lint

test:
name: Run Molecule tests.
runs-on: ubuntu-latest

steps:
- name: Check out the codebase.
uses: actions/checkout@v3

- name: Prepare the job environment.
uses: ./.github/workflows/prepare-action

- name: Run Molecule tests.
run: pipenv run molecule test

release:
name: Release new version on Ansible Galaxy
runs-on: ubuntu-latest
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"
25 changes: 25 additions & 0 deletions .github/workflows/prepare-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: 2022 Helmholtz Centre for Environmental Research (UFZ)
# SPDX-FileCopyrightText: 2022 Helmholtz-Zentrum Dresden-Rossendorf (HZDR)
#
# SPDX-License-Identifier: Apache-2.0

---
name: Install dependencies and prepare the environment.
description: Install the necessary dependencies for jobs.
runs:
using: composite
steps:
- name: Install pipenv.
run: pipx install pipenv
shell: bash

- name: Set up Python 3.
uses: actions/setup-python@v3
id: setup-python
with:
python-version: '3.9'
cache: 'pipenv'

- name: Install dependencies via pipenv.
run: pipenv install --dev
shell: bash
22 changes: 0 additions & 22 deletions .github/workflows/release.yml

This file was deleted.

80 changes: 0 additions & 80 deletions .gitlab-ci.yml

This file was deleted.

0 comments on commit a0933cd

Please sign in to comment.