Skip to content

CI

CI #13

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
tags: ["*"]
pull_request:
branches: ["main"]
schedule:
- cron: "0 17 * * 2"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
###########
# Testing #
###########
syntax-check:
strategy:
fail-fast: false
matrix:
version: ["7.0.0", "10.0.1", "11.4.0"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: alex-oleshkevich/setup-ansible@v1.0.1
with:
version: ${{ matrix.version }}
- name: Prepare Ansible project
run: |
mkdir -p tests/roles/
ln -s ../../ tests/roles/coreos-bootstrap
- run: ansible-playbook -i tests/inventory tests/test.yml --syntax-check
#############
# Releasing #
#############
release-github:
name: release (GitHub)
if: ${{ github.event_name == 'push'
&& startsWith(github.ref, 'refs/tags/') }}
needs: ["syntax-check"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Parse release version
id: release
run: echo "version=${GITHUB_REF#refs/tags/}"
>> $GITHUB_OUTPUT
- name: Parse CHANGELOG link
id: changelog
run: echo "link=${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.release.outputs.version }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release.outputs.version }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' CHANGELOG.md)"
>> $GITHUB_OUTPUT
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.release.outputs.version }}
body: |
[Changelog](${{ steps.changelog.outputs.link }})
prerelease: ${{ contains(steps.release.outputs.version, '-') }}