8000 Add parallel ci pipelines by ralphlange · Pull Request #71 · epics-training/training-vm · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/Containerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG IMAGE=debian:latest

FROM ${IMAGE}
ENV DEBIAN_FRONTEND=noninteractive

COPY ansible /ansible
WORKDIR /ansible

RUN apt-get update && apt-get install -y git ansible ansible-lint

RUN ansible-galaxy install -r requirements.yml || true
RUN ansible-playbook playbook.yml -e "@vars/ci-base-image.yml"

RUN rm -fr /ansible
15 changes: 15 additions & 0 deletions .github/workflows/Containerfile.fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG IMAGE=fedora:latest

FROM ${IMAGE}

RUN dnf install -y epel-release || dnf update -y --refresh
RUN dnf install -y git python3-pip python3-jmespath ansible
RUN pip3 install ansible-lint

COPY ansible /ansible
WORKDIR /ansible

RUN ansible-galaxy install -r requirements.yml || true
RUN ansible-playbook playbook.yml -e "@vars/ci-base-image.yml"

RUN rm -fr /ansible
15 changes: 15 additions & 0 deletions .github/workflows/Containerfile.rocky
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG IMAGE=rockylinux:latest

FROM $IMAGE

RUN dnf install -y epel-release || dnf update -y --refresh
RUN dnf install -y git python3-pip python3-jmespath ansible
RUN pip3 install ansible-lint

COPY ansible /ansible
WORKDIR /ansible

RUN ansible-galaxy install -r requirements.yml || true
RUN ansible-playbook playbook.yml -e "@vars/ci-base-image.yml"

RUN rm -fr /ansible
17 changes: 17 additions & 0 deletions .github/workflows/Containerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG IMAGE=ubuntu:latest

FROM $IMAGE
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:ansible/ansible \
&& apt-get install -y git ansible ansible-lint

COPY ansible /ansible
WORKDIR /ansible

RUN ansible-galaxy install -r requirements.yml || true
RUN ansible-playbook playbook.yml -e "@vars/ci-base-image.yml"

RUN rm -fr /ansible
19 changes: 0 additions & 19 deletions .github/workflows/_docker_build.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/ci.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/rebuild-container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "Rebuild Container Images"

on:
push:
branches:
- main
- 'parallel-ci-pipelines*'
paths:
- '.github/workflows/rebuild-container-images.yml'
- '.github/workflows/Containerfile.*'
- 'ansible/roles/initial_setup/**'
- 'ansible/roles/m-base/**'
- 'ansible/vars/ci-base-image.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'initial_setup.sh'
- 'update.sh'
pull_request:
paths:
- '.github/workflows/rebuild-container-images.yml'
- '.github/workflows/Containerfile.*'
- 'ansible/roles/initial_setup/**'
- 'ansible/roles/m-base/**'
- 'ansible/vars/ci-base-image.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'initial_setup.sh'
- 'update.sh'
workflow_dispatch:

jobs:
check:
uses: ./.github/workflows/_check.yml

build:
needs: check
if: needs.check.outputs.branch-pr == ''
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu
image: 'ubuntu:24.04'
- distro: rocky
image: 'rockylinux:9'
- distro: debian
image: 'debian:bookworm'
- distro: fedora
image: 'fedora:41'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lower case repository name
run: |
echo "REPO_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Build and push container image
uses: docker/build-push-action@v7
with:
context: .
file: ./.github/workflows/Containerfile.${{ matrix.distro }}
build-args: |
IMAGE=${{ matrix.image }}
push: true
tags: ghcr.io/${{ env.REPO_NAME }}/epics-training-base-${{ matrix.distro }}:latest
77 changes: 77 additions & 0 deletions .github/workflows/test-roles-areadetector.yml.autosave
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Test Ansible Roles: AreaDetector"

on:
push:
branches:
- main
- 'parallel-ci-pipelines*'
paths:
- '.github/workflows/test-ansible-roles.yml'
- 'ansible/configs/ci-*.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'ansible/roles/**'
- '!ansible/roles/initial_setup/**'
- '!ansible/roles/catrust/**'
- '!ansible/roles/common/**'
- '!ansible/roles/m-base/**'
- '!ansible/roles/epics-module/**'
pull_request:
paths:
- '.github/workflows/test-ansible-roles.yml'
- 'ansible/configs/ci-*.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'ansible/roles/**'
- '!ansible/roles/initial_setup/**'
- '!ansible/roles/catrust/**'
- '!ansible/roles/common/**'
- '!ansible/roles/m-base/**'
- '!ansible/roles/epics-module/**'
workflow_run:
workflows: ["Rebuild Container Images"]
types:
- completed
workflow_dispatch:

jobs:
check:
uses: ./.github/workflows/_check.yml

prep:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.lowercase.outputs.repo_name }}
steps:
- id: lowercase
run: echo "repo_name=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT

test:
needs: [check, prep]
name: "${{ matrix.distro }}: ${{ matrix.conf.name }}"
if: |
needs.check.outputs.branch-pr == '' &&
(github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
strategy:
fail-fast: false
matrix:
distro: [ubuntu, rocky, debian, fedora]
conf:
- name: "areaDetector"
id: "ci-areadetector"
- name: "oac-tree"
id: "ci-oac-tree"
- name: "Phoebus & Archiver"
id: "ci-phoebus-aa"
- name: "streamDevice & opcua"
id: "ci-stream-opcua"
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ needs.prep.outputs.repo_name }}/epics-training-base-${{ matrix.distro }}:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build ${{ matrix.conf.name }}
run: |
cd ansible
ansible-playbook -v playbook.yml -e "setup=${{ matrix.conf.id }}"
63 changes: 63 additions & 0 deletions .github/workflows/test-roles-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: "Test Roles: EPICS Modules"

on:
push:
branches:
- main
- 'parallel-ci-pipelines*'
paths:
- '.github/workflows/test-roles-modules.yml'
- 'ansible/vars/ci-*.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'ansible/roles/m-*/**'
- '!ansible/roles/m-base/**'
pull_request:
paths:
- '.github/workflows/test-roles-modules.yml'
- 'ansible/vars/ci-*.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'ansible/roles/m-*/**'
- '!ansible/roles/m-base/**'
workflow_run:
workflows: ["Rebuild Container Images"]
types:
- completed
workflow_dispatch:

jobs:
check:
uses: ./.github/workflows/_check.yml

prep:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.lowercase.outputs.repo_name }}
steps:
- id: lowercase
run: echo "repo_name=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT

test:
needs: [check, prep]
name: "${{ matrix.distro }}: ${{ matrix.conf.name }}"
if: |
needs.check.outputs.branch-pr == '' &&
(github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
strategy:
fail-fast: false
matrix:
distro: [ubuntu, rocky, debian, fedora]
conf:
- name: "EPICS Modules"
id: "ci-modules"
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ needs.prep.outputs.repo_name }}/epics-training-base-${{ matrix.distro }}:latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build ${{ matrix.conf.name }}
run: |
cd ansible
ansible-playbook -v playbook.yml -e "@vars/${{ matrix.conf.id }}.yml"
61 changes: 61 additions & 0 deletions .github/workflows/test-roles-oac-tree.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Test Roles: oac-tree"

on:
push:
branches:
- main
- 'parallel-ci-pipelines*'
paths:
- '.github/workflows/test-roles-oac-tree.yml'
- 'ansible/vars/ci-*.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'ansible/roles/oac-tree/**'
pull_request:
paths:
- '.github/workflows/test-roles-oac-tree.yml'
- 'ansible/vars/ci-*.yml'
- 'ansible/playbook.yml'
- 'ansible/requirements.yml'
- 'ansible/roles/oac-tree/**'
workflow_run:
workflows: ["Rebuild Container Images"]
types:
- completed
workflow_dispatch:

jobs:
check:
uses: ./.github/workflows/_check.yml

prep:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.lowercase.outputs.repo_name }}
steps:
- id: lowercase
run: echo "repo_name=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT

test:
needs: [check, prep]
name: "${{ matrix.distro }}: ${{ matrix.conf.name }}"
if: |
needs.check.outputs.branch-pr == '' &&
(github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
strategy:
fail-fast: false
matrix:
distro: [ubuntu, rocky, debian, fedora]
conf:
- name: "oac-tree"
id: "ci-oac-tree"
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ needs.prep.outputs.repo_name }}/epics-training-base-${{ matrix.distro }}:latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build ${{ matrix.conf.name }}
run: |
cd ansible
ansible-playbook -v playbook.yml -e "@vars/${{ matrix.conf.id }}.yml"
Loading
Loading
0