-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from rh-ecosystem-edge/matrix-works
Add scripts for matrix
- Loading branch information
Showing
8 changed files
with
82 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
name: Check remote DTK tags | ||
|
||
on: | ||
#name: Check remote DTK tags | ||
# | ||
#on: | ||
# schedule: | ||
# - cron: '*/5 * * * *' | ||
# workflow_dispatch: # Allow manual trigger | ||
[push] | ||
jobs: | ||
check-and-update-dtk-tags: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up skopeo | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y skopeo | ||
- name: Fetch remote DTK kernel version tags | ||
id: fetch-tags | ||
run: | | ||
DTKREPO="quay.io/build-and-sign/pa-driver-toolkit" | ||
TAGS=$(skopeo list-tags docker://$DTKREPO | jq -c '.Tags | sort') | ||
echo "::set-output name=tags::$TAGS" | ||
- name: Compare and update local DTK tags if remote changed | ||
id: compare | ||
run: | | ||
FILE="kernel-versions.json" | ||
RAW_TAGS='${{ steps.fetch-tags.outputs.tags }}' | ||
NEW_TAGS=$(echo "$RAW_TAGS" | jq -c '.') | ||
NEW_TAGS_JSON=$(jq -n \ | ||
--argjson kernel_versions "${{ steps.fetch-tags.outputs.tags }}" \ | ||
--arg date "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ | ||
'{kernel_versions: $kernel_versions, last_updated: $date}') | ||
if [ -f "$FILE" ]; then | ||
OLD_TAGS=$(cat "$FILE" | jq -c '.kernel_versions | sort') | ||
else | ||
OLD_TAGS="[]" | ||
fi | ||
NEW_TAGS=$(echo "$NEW_TAGS_JSON" | jq -c '.kernel_versions | sort') | ||
if [ "$NEW_TAGS" != "$OLD_TAGS" ]; then | ||
echo "New kernel versions found." | ||
echo "$NEW_TAGS_JSON" > "$FILE" | ||
echo "CHANGED=true" >> $GITHUB_ENV | ||
else | ||
echo "No new kernel versions found." | ||
echo "CHANGED=false" >> $GITHUB_ENV | ||
fi | ||
- name: Commit and push changes for new found kernel versions | ||
if: env.CHANGED == 'true' | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add kernel-versions.json | ||
git commit -m "Update available DTK Kernel versions tags" | ||
git push | ||
# [push] | ||
#jobs: | ||
# check-and-update-dtk-tags: | ||
# runs-on: ubuntu-latest | ||
# | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v3 | ||
# | ||
# - name: Set up skopeo | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get install -y skopeo | ||
# | ||
# - name: Fetch remote DTK kernel version tags | ||
# id: fetch-tags | ||
# run: | | ||
# DTKREPO="quay.io/build-and-sign/pa-driver-toolkit" | ||
# TAGS=$(skopeo list-tags docker://$DTKREPO | jq -c '.Tags | sort') | ||
# echo "::set-output name=tags::$TAGS" | ||
# | ||
# - name: Compare and update local DTK tags if remote changed | ||
# id: compare | ||
# run: | | ||
# FILE="kernel-versions.json" | ||
# RAW_TAGS='${{ steps.fetch-tags.outputs.tags }}' | ||
# NEW_TAGS=$(echo "$RAW_TAGS" | jq -c '.') | ||
# NEW_TAGS_JSON=$(jq -n \ | ||
# --argjson kernel_versions "${{ steps.fetch-tags.outputs.tags }}" \ | ||
# --arg date "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ | ||
# '{kernel_versions: $kernel_versions, last_updated: $date}') | ||
# if [ -f "$FILE" ]; then | ||
# OLD_TAGS=$(cat "$FILE" | jq -c '.kernel_versions | sort') | ||
# else | ||
# OLD_TAGS="[]" | ||
# fi | ||
# NEW_TAGS=$(echo "$NEW_TAGS_JSON" | jq -c '.kernel_versions | sort') | ||
# if [ "$NEW_TAGS" != "$OLD_TAGS" ]; then | ||
# echo "New kernel versions found." | ||
# echo "$NEW_TAGS_JSON" > "$FILE" | ||
# echo "CHANGED=true" >> $GITHUB_ENV | ||
# else | ||
# echo "No new kernel versions found." | ||
# echo "CHANGED=false" >> $GITHUB_ENV | ||
# fi | ||
# | ||
# - name: Commit and push changes for new found kernel versions | ||
# if: env.CHANGED == 'true' | ||
# run: | | ||
# git config user.name "github-actions[bot]" | ||
# git config user.email "github-actions[bot]@users.noreply.github.com" | ||
# git add kernel-versions.json | ||
# git commit -m "Update available DTK Kernel versions tags" | ||
# git push | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
name: Python package | ||
name: Get Kernel List | ||
|
||
on: [pull_request] | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- name: checkout repo content | ||
uses: actions/checkout@v2 | ||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: '3.9' | ||
- name: install python packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r scripts/requirements.txt | ||
- name: Display kernel list | ||
run: python scripts/kernel-list.py | ||
run: python scripts/kernels.py | ||
- name: Commit kernel list updates | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "Updating the kernel version list" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"5.14.0-427.13.1.el9_4.x86_64": "4ead5b9864b4839e4e5d2a6348bd7deba5682d057952eab83695d62ad2ea3652", "5.14.0-503.11.1.el9_5.x86_64": "386d86254354e29d3b864523aed478dba3a982c67968b5e2da9ab863deab9a54", "5.14.0-503.19.1.el9_5.x86_64": "de5624ba39358ba4ba962535e4a972a64bd62ef57bd286834eded962856ed39a"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
46283b373ca65ad42ac9f3cf3bfef316 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requests==2.32.3 |