Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/main/pandas-2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk authored Jun 25, 2024
2 parents 3cd51ce + 4ca9338 commit c2a184f
Show file tree
Hide file tree
Showing 43 changed files with 450 additions and 746 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fedora-copr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
--description "`cat project-description.md`" \
--unlisted-on-hp on \
--enable-net on \
--runtime-repo-dependency "https://download.copr.fedorainfracloud.org/results/%40fedora-llvm-team/llvm-compat-packages/fedora-\$releasever-\$basearch" \
--runtime-repo-dependency "https://download.copr.fedorainfracloud.org/results/%40fedora-llvm-team/llvm-compat-packages/\$distname-\$releasever-\$basearch" \
--multilib on \
--appstream off \
--delete-after-days 32 \
Expand Down
148 changes: 0 additions & 148 deletions .github/workflows/generate-snapshot-tarballs.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-python
- uses: pre-commit/[email protected]
1 change: 1 addition & 0 deletions .github/workflows/retest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
shell: bash -e {0}
env:
GITHUB_TOKEN: ${{ secrets.GH_TEST_TOKEN }}
chroots: ${{ env.chroots }}
run: |
python3 snapshot_manager/main.py \
--github-repo ${GITHUB_REPOSITORY} \
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/sync-on-llvm-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: "Sync on LLVM version"

on:
schedule:
# Everyday at 00:00am
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
- cron: '0 0 * * *'

workflow_dispatch:
inputs:
commit_hash:
description: 'Commit hash to use without tests'
required: true
default: main
type: string

permissions:
# For release assets to be deletable we need this permission
contents: write

jobs:

# In order to re-build source snapshots and upload them, we must first delete
# the old ones from today; otherwise there would be a conflict. As a measure
# of not storing old snapshots for too long we'll delete older ones here as
# well.
regenerate-assets:
name: "(Re)generate assets"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: ./.github/actions/prepare-python

- name: "delete assets older than 33 days and from today"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/delete-assets.py \
--token ${{ secrets.GITHUB_TOKEN }} \
--project ${{ github.repository }} \
--release-name snapshot-version-sync \
--delete-older 33 \
--delete-today
- name: Determine good commit (on schedule only)
uses: ./.github/actions/get-good-commit
id: good-commit
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkout-path: .
github-project: llvm/llvm-project
start-ref: main
max-tries: 500

- name: "Generate snapshot version info"
shell: bash -e {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${{github.event_name}}" == "workflow_dispatch" ]]; then
commit_hash=${{inputs.commit_hash}}
else
commit_hash=${{ steps.good-commit.outputs.good-commit }}
fi
if [[ "$commit_hash" =~ ^[0-9a-f]{40}$ ]]; then
echo "commit_hash looks like a SHA1. No need to resolve: ${commit_hash}"
else
echo "commit_hash doesn't look like a SHA1 (maybe it is a branch or tag name). Trying to resolve it: ${commit_hash}"
# See https://docs.github.com/de/rest/commits/commits?apiVersion=2022-11-28#list-branches-for-head-commit
commit_hash=`curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{env.GITHUB_TOKEN}}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/llvm/llvm-project/commits/${commit_hash}/branches-where-head \
| jq -r '.[0].commit.sha'`
fi
echo "commit_hash=${commit_hash}" >> $GITHUB_ENV
yyyymmdd=$(date +%Y%m%d)
versionfile=LLVMVersion.cmake
url=https://raw.githubusercontent.com/llvm/llvm-project/${commit_hash}/cmake/Modules/${versionfile}
echo "Getting ${url}"
curl -sL -o ${versionfile} ${url}
echo "Version file:"
cat ${versionfile}
llvm_snapshot_git_revision=${commit_hash}
llvm_snapshot_version=`grep -ioP 'set\(\s*LLVM_VERSION_(MAJOR|MINOR|PATCH)\s\K[0-9]+' ${versionfile} | paste -sd '.'`
echo "${llvm_snapshot_version}" > llvm-release-${yyyymmdd}.txt
echo "${llvm_snapshot_git_revision}" > llvm-git-revision-${yyyymmdd}.txt
echo "llvm_release=`cat llvm-release-${yyyymmdd}.txt`"
echo "llvm_git_revision=`cat llvm-git-revision-${yyyymmdd}.txt`"
./scripts/upload-source-snapshots.py \
--token ${{ secrets.GITHUB_TOKEN }} \
--project ${{ github.repository }} \
--release-name snapshot-version-sync \
--yyyymmdd "$(date +%Y%m%d)"
79 changes: 51 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,58 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=3000']
- id: check-docstring-first
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/PyCQA/isort
rev: "5.13.2"
hooks:
- id: isort

# See https://tmt.readthedocs.io/en/latest/guide.html#checking-data-validity
- repo: https://github.com/teemtee/tmt.git
rev: 1.32.2
hooks:
- id: tmt-lint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: fix-byte-order-marker
- id: detect-private-key
- id: check-toml
- id: check-yaml
args:
- "--allow-multiple-documents"
- id: check-added-large-files
args: ['--maxkb=3000']
- id: check-docstring-first
- id: name-tests-test
- id: requirements-txt-fixer

# See https://black.readthedocs.io/en/stable/integrations/source_version_control.html
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.12
force-exclude: "^snapshot_manager/tests/(test_logs|testing-farm-logs)/"
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args:
- "--py311-plus"

# See https://tmt.readthedocs.io/en/latest/guide.html#checking-data-validity
- repo: https://github.com/teemtee/tmt.git
rev: 1.32.2
hooks:
- id: tmt-lint

# See https://black.readthedocs.io/en/stable/integrations/source_version_control.html
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.12
force-exclude: "^snapshot_manager/tests/(test_logs|testing-farm-logs)/"
exclude: "^(snapshot_manager/tests/(test_logs|testing-farm-logs)/|media)"
1 change: 0 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
:showtitle:
:homepage: https://github.com/fedora-llvm-team/llvm-snapshots

image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/generate-snapshot-tarballs.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/generate-snapshot-tarballs.yml"]
image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/fedora-copr-build.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/fedora-copr-build.yml"]
image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/check-snapshots.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/check-snapshots.yml"]
image:https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/python-format-and-tests.yml/badge.svg[link="https://github.com/fedora-llvm-team/llvm-snapshots/actions/workflows/python-format-and-tests.yml"]
Expand Down
Loading

0 comments on commit c2a184f

Please sign in to comment.