mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
Adjust workflows. — py3_pyyaml → 6.0.3 (#12980)
* Adjust workflows. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Only upload binaries, do not update branches during Build workflow. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust commit log. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Change merge variable to indicate rebase. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Fix getrealdeps.rb file copy. Fix rubocop Naming patch exclusion. Adjust Package Changes determinations in workflow. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add back libyaml dep. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d44f4fc7e3
commit
261a043520
17
.github/workflows/Build.yml
vendored
17
.github/workflows/Build.yml
vendored
@@ -24,7 +24,7 @@ on:
|
||||
branch:
|
||||
description: "Branch of chromebrew/chromebrew to run on, if different from this branch."
|
||||
required: false
|
||||
update_merge_master:
|
||||
update_rebase_to_master:
|
||||
description: "Update Branch."
|
||||
required: false
|
||||
type: boolean
|
||||
@@ -85,7 +85,7 @@ jobs:
|
||||
gh pr ready --undo || true
|
||||
# Try to update branch before building if a PR already
|
||||
# exists.
|
||||
[[ "${{ ( inputs.update_merge_master ) }}" == 'true' ]] && gh pr update-branch || true
|
||||
[[ "${{ ( inputs.update_rebase_to_master ) }}" == 'true' ]] && gh pr update-branch --rebase || true
|
||||
fi
|
||||
- name: Set Timestamp
|
||||
id: set-timestamp
|
||||
@@ -306,19 +306,6 @@ jobs:
|
||||
grep "Built and Uploaded:" /tmp/build.log || true
|
||||
echo "Deleting build output directories."
|
||||
sudo rm -rf release pkg_cache
|
||||
- name: Add updated packages to branch.
|
||||
id: push-check
|
||||
run: |
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git config user.name "${{ github.actor }}"
|
||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
git stash || true
|
||||
git pull
|
||||
git stash pop || true
|
||||
git add -A
|
||||
git commit -m "${{ inputs.branch || github.ref_name }}: Build Run on ${PLATFORM}." && git push
|
||||
git log --oneline -10
|
||||
fi
|
||||
build-check:
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
|
||||
31
.github/workflows/Generate-PR.yml
vendored
31
.github/workflows/Generate-PR.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
pr_title:
|
||||
description: "Title of PR"
|
||||
required: false
|
||||
update_merge_master:
|
||||
update_rebase_to_master:
|
||||
description: "Update Branch."
|
||||
required: false
|
||||
type: boolean
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
echo "Setting ${PR_NUMBER} to Draft while workflow runs."
|
||||
gh pr ready --undo || true
|
||||
fi
|
||||
if [[ "${{ ( inputs.update_merge_master ) }}" == 'true' ]]; then
|
||||
if [[ "${{ ( inputs.update_rebase_to_master ) }}" == 'true' ]]; then
|
||||
if [[ -n ${PR_NUMBER} ]]; then
|
||||
# Try to update branch immediately.
|
||||
gh pr update-branch || true
|
||||
@@ -89,7 +89,6 @@ jobs:
|
||||
# before continuing.
|
||||
gh pr update-branch || true
|
||||
fi
|
||||
git pull
|
||||
fi
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
@@ -317,10 +316,10 @@ jobs:
|
||||
git config user.name "${{ github.actor }}"
|
||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
git stash || true
|
||||
git pull
|
||||
git fetch origin ${{ inputs.branch || github.ref_name }}
|
||||
git stash pop || true
|
||||
git add -A
|
||||
git commit -m "${{ inputs.branch || github.ref_name }}: Package File Update Run on ${PLATFORM} container." && git push
|
||||
git commit -m "${{ inputs.branch || github.ref_name }}: Package File Update Run on ${PLATFORM} container." && git push origin ${{ inputs.branch || github.ref_name }}
|
||||
git log --oneline -10
|
||||
fi
|
||||
build-check:
|
||||
@@ -353,13 +352,26 @@ jobs:
|
||||
sudo gem install ruby-libversion
|
||||
- name: Save git log
|
||||
id: save-git-log
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }}
|
||||
run: |
|
||||
PR_NUMBER=$(gh pr list -L 1 -s open -H ${{ inputs.branch || github.ref_name }} | cut -f1)
|
||||
if [[ -n ${PR_NUMBER} ]]; then
|
||||
# Try to update branch immediately.
|
||||
gh pr update-branch --rebase || true
|
||||
else
|
||||
gh pr create -d -b WIP -t "WIP ${{ inputs.branch || github.ref_name }}"
|
||||
# Create a draft PR and immediately try to update the branch
|
||||
# before continuing.
|
||||
gh pr update-branch --rebase || true
|
||||
fi
|
||||
git config user.name "${{ github.actor }}"
|
||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
git checkout master && git pull
|
||||
git checkout master && git fetch origin master
|
||||
git checkout "${{ inputs.branch || github.ref_name }}"
|
||||
git log --oneline -10
|
||||
git log --oneline master..${{ inputs.branch || github.ref_name }} | grep -v "Merge branch 'master'\|Build Run on\|Package File Update Run on\|lint$" | tr '\n' '\0' | xargs -0 -n1 echo "- $*" >> /tmp/commits.txt
|
||||
# git rebase origin/master || git rebase --abort
|
||||
git log --no-merges --oneline -10
|
||||
git log --no-merges --oneline master..${{ inputs.branch || github.ref_name }} | grep -v "Merge branch 'master'\|Build Run on\|Package File Update Run on\|lint$" | tr '\n' '\0' | xargs -0 -n1 echo "- $*" >> /tmp/commits.txt
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v47
|
||||
@@ -377,7 +389,6 @@ jobs:
|
||||
- '!manifest/**'
|
||||
- '!packages/*.rb'
|
||||
- '!.github/**'
|
||||
since_last_remote_commit: true
|
||||
- name: Get GH Token
|
||||
id: get_workflow_token
|
||||
uses: peter-murray/workflow-application-token-action@v4
|
||||
@@ -474,7 +485,7 @@ jobs:
|
||||
gh pr edit --add-reviewer chromebrew/active $PR_EDIT_LABEL_FLAG --title "$(echo "${PR_TITLE}" | sed -e "s/^'//" -e "s/'$//") ${PKG_DELTAS}" -F /tmp/pr.txt
|
||||
fi
|
||||
# Try to update branch before finishing.
|
||||
[[ "${{ ( inputs.update_merge_master ) }}" == 'true' ]] && gh pr update-branch || true
|
||||
[[ "${{ ( inputs.update_rebase_to_master ) }}" == 'true' ]] && gh pr update-branch --rebase || true
|
||||
# Draft PRs can not be set to automerge.
|
||||
if [[ ${DRAFT_PR} == 'true' ]]; then
|
||||
gh pr ready --undo || true
|
||||
|
||||
2
.github/workflows/Unit-Test.yml
vendored
2
.github/workflows/Unit-Test.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
runner: ubuntu-24.04
|
||||
runs-on: ${{ matrix.runner }}
|
||||
concurrency:
|
||||
group: ${{ matrix.arch }}-${{ github.workflow }}-${{ github.ref }}
|
||||
group: ${{ matrix.arch }}-${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -106,7 +106,7 @@ Metrics:
|
||||
# Many package names include - or _ and we don't want to lose that information by mistakenly converting into CamelCase.
|
||||
Naming/ClassAndModuleCamelCase:
|
||||
Exclude:
|
||||
- 'packages/*'
|
||||
- /**/packages/*
|
||||
|
||||
# If there is meaningful information to convey about the contents of a heredoc, a comment is the best way to do it.
|
||||
# Forcing unique names for all heredoc delimiters does not improve documentation in the vast majority of cases.
|
||||
|
||||
@@ -17,8 +17,8 @@ class Py3_pyyaml < Pip
|
||||
})
|
||||
|
||||
depends_on 'glibc' # R
|
||||
depends_on 'libyaml' # R
|
||||
depends_on 'python3' => :build
|
||||
depends_on 'libyaml' => :build
|
||||
depends_on 'python3' # R
|
||||
|
||||
no_source_build
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/local/bin/ruby
|
||||
# getrealdeps version 2.2 (for Chromebrew)
|
||||
# getrealdeps version 2.3 (for Chromebrew)
|
||||
# Author: Satadru Pramanik (satmandu) satadru at gmail dot com
|
||||
require 'fileutils'
|
||||
|
||||
@@ -44,6 +44,8 @@ end
|
||||
|
||||
# Write the missing dependencies to the package file.
|
||||
def write_deps(pkg_file, pkgdeps, pkg)
|
||||
# pkg is not pkg.name in this function.
|
||||
# e.g., pkg is Package::Py3_pyyaml
|
||||
# Add special deps for perl, pip, python, and ruby gem packages.
|
||||
case pkg.superclass.to_s
|
||||
when 'PERL'
|
||||
@@ -78,7 +80,7 @@ def write_deps(pkg_file, pkgdeps, pkg)
|
||||
puts "#{pkg.name}: #{exception[:exclusion_regex]} - #{exception[:comments]}..".orange if pkgdeps_length != pkgdeps.length
|
||||
end
|
||||
|
||||
puts "\nPackage #{pkg} has runtime library dependencies on these packages:".lightblue
|
||||
puts "\nPackage #{pkg.name} has runtime library dependencies on these packages:".lightblue
|
||||
pkgdeps.each do |i|
|
||||
puts " depends_on '#{i}' # R".lightgreen
|
||||
end
|
||||
@@ -87,7 +89,7 @@ def write_deps(pkg_file, pkgdeps, pkg)
|
||||
missingpkgdeps = pkgdeps.reject { File.read(pkg_file).include?("depends_on '#{it}'") unless File.read(pkg_file).include?("depends_on '#{it}' => :build") }
|
||||
|
||||
unless missingpkgdeps.empty?
|
||||
puts "\nPackage file #{pkg}.rb is missing these runtime library dependencies:".orange
|
||||
puts "\nPackage file #{pkg_file} is missing these runtime library dependencies:".orange
|
||||
puts " depends_on '#{missingpkgdeps.join("' # R\n depends_on '")}' # R".orange
|
||||
end
|
||||
|
||||
@@ -143,10 +145,11 @@ def write_deps(pkg_file, pkgdeps, pkg)
|
||||
|
||||
# Clean with rubocop.
|
||||
system "rubocop -c #{rubocop_config} -A #{pkg_file}"
|
||||
FileUtils.cp pkg_file, "#{CREW_LOCAL_REPO_ROOT}/packages/#{pkg}.rb" unless CREW_LOCAL_REPO_ROOT.to_s.empty?
|
||||
FileUtils.cp pkg_file, "#{CREW_LOCAL_REPO_ROOT}/packages/#{File.basename(pkg_file)}" unless CREW_LOCAL_REPO_ROOT.to_s.empty?
|
||||
end
|
||||
|
||||
def main(pkg)
|
||||
# pkg is pkg.name in this function.
|
||||
puts "Checking for the runtime dependencies of #{pkg}...".lightblue
|
||||
pkg_file = File.join(CREW_PACKAGES_PATH, "#{pkg}.rb")
|
||||
FileUtils.cp File.join(CREW_LOCAL_REPO_ROOT, "packages/#{pkg}.rb"), pkg_file if !CREW_LOCAL_REPO_ROOT.to_s.empty? && File.file?(File.join(CREW_LOCAL_REPO_ROOT, "packages/#{pkg}.rb"))
|
||||
|
||||
Reference in New Issue
Block a user