Check snapshots of the last days #5262
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
name: "Check snapshots of the last days" | |
on: | |
schedule: | |
# At every 60th minute. | |
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule | |
- cron: "*/60 * * * *" | |
# This is used when a /retest command asks for a re-check. | |
workflow_dispatch: | |
inputs: | |
yyyymmdd: | |
description: 'year month day' | |
required: true | |
type: string | |
strategy: | |
description: 'strategy (e.g. standalone, big-merge)' | |
required: true | |
type: string | |
permissions: | |
# We need this in order to create or update snapshot issues | |
issues: write | |
jobs: | |
check-snapshot: | |
strategy: | |
fail-fast: false | |
matrix: | |
today_minus_n_days: [0, 1, 2] | |
name: [big-merge, pgo] | |
include: | |
# - name: standalone | |
# maintainer_handle: "tbaederr" | |
# copr_ownername: "@fedora-llvm-team" | |
# copr_project_tpl: "llvm-snapshots-incubator-YYYYMMDD" | |
# copr_monitor_tpl: "https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-incubator-YYYYMMDD/monitor/" | |
# packages: "python-lit llvm clang lld compiler-rt libomp" | |
- name: big-merge | |
maintainer_handle: "tuliom" | |
copr_ownername: "@fedora-llvm-team" | |
copr_project_tpl: "llvm-snapshots-big-merge-YYYYMMDD" | |
copr_monitor_tpl: "https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-big-merge-YYYYMMDD/monitor/" | |
chroot_pattern: '^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-)' | |
packages: "llvm" | |
- name: pgo | |
maintainer_handle: "kwk" | |
copr_ownername: "@fedora-llvm-team" | |
copr_project_tpl: "llvm-snapshots-pgo-YYYYMMDD" | |
copr_monitor_tpl: "https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-pgo-YYYYMMDD/monitor/" | |
chroot_pattern: '^(fedora-(rawhide|[0-9]+)|rhel-[8,9]-|centos-stream-10)' | |
packages: "llvm" | |
# - name: bootstrap | |
# maintainer_handle: "kwk" | |
# copr_ownername: "@fedora-llvm-team" | |
# copr_project_tpl: "llvm-snapshots-bootstrap-YYYYMMDD" | |
# copr_monitor_tpl: "https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots-bootstrap-YYYYMMDD/monitor/" | |
# chroot_pattern: 'fedora-39-x86_64' | |
# packages: "llvm" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Copr config file | |
if: github.event_name != 'workflow_dispatch' || (matrix.today_minus_n_days == 0 && inputs.strategy == matrix.name) | |
env: | |
# You need to have those secrets in your repo. | |
# See also: https://copr.fedorainfracloud.org/api/. | |
COPR_CONFIG_FILE: ${{ secrets.COPR_CONFIG }} | |
run: | | |
mkdir -p ~/.config | |
printf "$COPR_CONFIG_FILE" > ~/.config/copr | |
- name: Install Copr CLI | |
if: github.event_name != 'workflow_dispatch' || (matrix.today_minus_n_days == 0 && inputs.strategy == matrix.name) | |
run: | | |
sudo apt-get install -y lsb-release diffutils pcre2-utils jq | |
- uses: actions/checkout@v4 | |
if: github.event_name != 'workflow_dispatch' || (matrix.today_minus_n_days == 0 && inputs.strategy == matrix.name) | |
- uses: ./.github/actions/prepare-python | |
if: github.event_name != 'workflow_dispatch' || (matrix.today_minus_n_days == 0 && inputs.strategy == matrix.name) | |
- name: "Check day (today minus ${{matrix.today_minus_n_days}} days)" | |
if: github.event_name != 'workflow_dispatch' || (matrix.today_minus_n_days == 0 && inputs.strategy == matrix.name) | |
shell: bash -e {0} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TESTING_FARM_API_TOKEN_PUBLIC_RANCH: ${{ secrets.TESTING_FARM_API_TOKEN_PUBLIC_RANCH }} | |
TESTING_FARM_API_TOKEN_REDHAT_RANCH: ${{ secrets.TESTING_FARM_API_TOKEN_REDHAT_RANCH }} | |
run: | | |
extra_args="" | |
if [[ ! -z "${{ matrix.chroot_pattern }}" ]]; then | |
extra_args="${extra_args} --chroot-pattern ${{matrix.chroot_pattern}}" | |
fi | |
if [[ "${{github.event_name}}" == "workflow_dispatch" ]]; then | |
yyyymmdd=${{inputs.yyyymmdd}} | |
else | |
yyyymmdd=`date --date='${{matrix.today_minus_n_days}} days ago' +%Y%m%d` | |
fi | |
python3 snapshot_manager/main.py \ | |
--github-repo ${GITHUB_REPOSITORY} \ | |
--github-token-env GITHUB_TOKEN \ | |
check ${extra_args}\ | |
--maintainer-handle ${{matrix.maintainer_handle}} \ | |
--packages ${{matrix.packages}} \ | |
--build-strategy ${{matrix.name}} \ | |
--copr-project-tpl ${{matrix.copr_project_tpl}} \ | |
--copr-monitor-tpl ${{matrix.copr_monitor_tpl}} \ | |
--yyyymmdd $yyyymmdd |