Skip to content

Commit

Permalink
Improve CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Oct 26, 2023
1 parent 29a0269 commit e618472
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
29 changes: 3 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,12 @@ on:

jobs:
Perfecto:
name: Perfecto
runs-on: ubuntu-latest

strategy:
matrix:
image: [ 'ol7', 'ol8', 'ol9']

steps:
- name: Code checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install perfecto-container
run: |
wget https://kaos.sh/perfecto/perfecto-container
chmod +x perfecto-container
- name: Run Perfecto check
env:
IMAGE: ghcr.io/essentialkaos/perfecto:${{matrix.image}}
run: ./perfecto-container -A PF20 $(git diff --name-status origin/master | tr '\t' ' ' | grep -Ev '(^D| test/)' | grep '\.spec' | rev | cut -f1 -d' ' | rev | sort)
uses: ./.github/workflows/perfecto.yml
with:
image: ${{ matrix.image }}

Bibop:
name: Bibop Validation
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/perfecto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Perfecto

on:
workflow_call:
inputs:
image:
required: true
type: string

jobs:
Perfecto:
name: Perfecto
runs-on: ubuntu-latest

steps:
- name: Code checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Show verion of Perfecto in docker image
run: |
docker run ghcr.io/essentialkaos/perfecto:${{inputs.image}} --version
- name: Install perfecto-container
run: |
wget https://kaos.sh/perfecto/perfecto-container
chmod +x perfecto-container
- name: Run Perfecto check
env:
IMAGE: ghcr.io/essentialkaos/perfecto:${{inputs.image}}
run: ./perfecto-container -A PF20 $(git diff --name-status origin/master | tr '\t' ' ' | grep -Ev '(^D| tests/)' | grep '\.spec' | rev | cut -f1 -d' ' | rev | sort)

0 comments on commit e618472

Please sign in to comment.