Skip to content

Commit

Permalink
Merge pull request #1460 from m-1-k-3/gcc_kernel_workflow
Browse files Browse the repository at this point in the history
Add gcc and linux workflow
  • Loading branch information
m-1-k-3 authored Feb 13, 2025
2 parents 1afe761 + 5dce250 commit 1e0f4b2
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 4 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/gcc_data_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update GCC version database

on:
schedule:
- cron: '0 0 * * 0' # do it every week
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
update_gcc_db:
if: github.repository_owner == 'e-m-b-a'
runs-on: ubuntu-latest

steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Install requirements
run: |
sudo apt-get update -y
sudo apt-get install curl -y
- name: update GCC version db
run: |
./helpers/generate_gcc_info.sh || exit 1
./helpers/generate_gcc_libstdc_info.sh || exit 1
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update GCC version database
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: gcc_update
delete-branch: true
title: 'GCC version database update'
body: |
Update report
- Updated latest GCC version details
labels: |
db_update
automated pr
milestone: 0
draft: false
43 changes: 43 additions & 0 deletions .github/workflows/linux_kernel_data_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Update Linux Kernel version database

on:
schedule:
- cron: '0 0 * * 0' # do it every week
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
update_kernel_db:
if: github.repository_owner == 'e-m-b-a'
runs-on: ubuntu-latest

steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Install requirements
run: |
sudo apt-get update -y
sudo apt-get install curl -y
- name: update Linux kernel version db
run: |
./helpers/generate_kernel_info.sh || exit 1
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update Linux kernel version database
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: gcc_update
delete-branch: true
title: 'Linux kernel version database update'
body: |
Update report
- Updated latest Linux kernel version details
labels: |
db_update
automated pr
milestone: 0
draft: false
3 changes: 2 additions & 1 deletion helpers/generate_gcc_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ GCC_OUTPUT_CSV="./config/gcc_details.csv"
curl "${GCC_RELEASES_HTML}" > "${GCC_RELEASES_FILE}"

if ! [[ -f "${GCC_RELEASES_FILE}" ]]; then
print_output "[-] Error downloading ${GCC_RELEASES_FILE}"
print_output "[-] Error downloading ${GCC_RELEASES_FILE}" "no_log"
exit 1
fi

[[ -f "${GCC_OUTPUT_CSV}" ]] && rm "${GCC_OUTPUT_CSV}"
Expand Down
6 changes: 4 additions & 2 deletions helpers/generate_gcc_libstdc_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ curl "${GCC_RELEASES_HTML}" > "${GCC_RELEASES_FILE}"
curl "${GCC_STD_HTML}" > "${GCC_STC_MATCHING_FILE}"

if ! [[ -f "${GCC_STC_MATCHING_FILE}" ]]; then
print_output "[-] Error downloading ${GCC_STD_HTML}"
print_output "[-] Error downloading ${GCC_STD_HTML}" "no_log"
exit 1
fi
if ! [[ -f "${GCC_RELEASES_FILE}" ]]; then
print_output "[-] Error downloading ${GCC_RELEASES_FILE}"
print_output "[-] Error downloading ${GCC_RELEASES_FILE}" "no_log"
exit 1
fi

[[ -f "${GCC_OUTPUT_CSV}" ]] && rm "${GCC_OUTPUT_CSV}"
Expand Down
3 changes: 2 additions & 1 deletion helpers/generate_kernel_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ KERNEL_OUTPUT_CSV="./config/kernel_details.csv"
curl -s "${KERNEL_RELEASES_URL}" > "${KERNEL_RELEASES_FILE}"

if ! [[ -f "${KERNEL_RELEASES_FILE}" ]]; then
print_output "[-] Error downloading ${KERNEL_RELEASES_FILE}"
print_output "[-] Error downloading ${KERNEL_RELEASES_FILE}" "no_log"
exit 1
fi

[[ -f "${KERNEL_OUTPUT_CSV}" ]] && rm "${KERNEL_OUTPUT_CSV}"
Expand Down

0 comments on commit 1e0f4b2

Please sign in to comment.