Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create check-anywhere.yml #94

Open
wants to merge 3 commits into
base: VUR
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions .github/workflows/check-anywhere.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Check build anywhere

on:
pull_request:
paths:
- 'srcpkgs/**'
push:
paths:
- 'srcpkgs/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Lint changed templates.
xlint:
name: Lint templates
runs-on: ubuntu-latest

container:
image: 'ghcr.io/void-linux/void-buildroot-musl:20240526R1'
env:
PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
LICENSE_LIST: common/travis/license.lst

steps:
- name: Prepare container
run: |
# switch to repo-ci mirror
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
# Sync and upgrade once, assume error comes from xbps update
xbps-install -Syu || xbps-install -yu xbps
# Upgrade again (in case there was a xbps update)
xbps-install -yu
# install tools needed for lints
xbps-install -y grep curl git
- name: Clone and checkout
uses: classabbyamp/treeless-checkout-action@v1
- name: Create hostrepo and prepare masterdir
run: |
ln -s "$(pwd)" /hostrepo &&
common/travis/set_mirror.sh &&
common/travis/prepare.sh &&
common/travis/fetch-xtools.sh
- run: common/travis/changed_templates.sh
- name: Run lints
run: |
rv=0
common/travis/xlint.sh || rv=1
common/travis/verify-update-check.sh || rv=1
exit $rv

# Build changed packages.
build:
name: Build packages
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.pull_request.body, '[ci skip]')"

container:
image: ghcr.io/void-linux/void-buildroot-${{ matrix.config.libc }}:20240526R1
options: --platform ${{ matrix.config.platform }}
env:
PATH: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
ARCH: '${{ matrix.config.arch }}'
BOOTSTRAP: '${{ matrix.config.host }}'
TEST: '${{ matrix.config.test }}'
HOSTREPO: /hostrepo

strategy:
fail-fast: false
matrix:
config:
- { arch: x86_64, host: x86_64, libc: glibc, platform: linux/amd64, test: 1 }
- { arch: i686, host: i686, libc: glibc, platform: linux/386, test: 1 }
- { arch: aarch64, host: x86_64, libc: glibc, platform: linux/amd64, test: 0 }
- { arch: armv7l, host: x86_64, libc: glibc, platform: linux/amd64, test: 0 }
- { arch: x86_64-musl, host: x86_64-musl, libc: musl, platform: linux/amd64, test: 1 }
- { arch: armv6l-musl, host: x86_64-musl, libc: musl, platform: linux/amd64, test: 0 }
- { arch: aarch64-musl, host: x86_64-musl, libc: musl, platform: linux/amd64, test: 0 }

steps:
- name: Prepare container
run: |
# switch to repo-ci mirror
mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
# Sync and upgrade once, assume error comes from xbps update
xbps-install -Syu || xbps-install -yu xbps
# Upgrade again (in case there was a xbps update)
xbps-install -yu

- name: Clone and checkout
env:
PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
uses: classabbyamp/treeless-checkout-action@v1
- name: Create hostrepo and prepare masterdir
run: |
ln -s "$(pwd)" /hostrepo &&
common/travis/set_mirror.sh &&
common/travis/prepare.sh &&
common/travis/fetch-xtools.sh
- name: Find changed templates
env:
PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
run: common/travis/changed_templates.sh

- name: Build and check packages
run: |
(
here="$(pwd)"
cd /
"$here/common/travis/build.sh" "$BOOTSTRAP" "$ARCH" "$TEST"
)

- name: Show files
run: |
(
here="$(pwd)"
cd /
"$here/common/travis/show_files.sh" "$BOOTSTRAP" "$ARCH"
)

- name: Compare to previous
run: |
(
here="$(pwd)"
cd /
"$here/common/travis/xpkgdiff.sh" "$BOOTSTRAP" "$ARCH"
)

- name: Check file conflicts
if: matrix.config.arch == 'x86_64' # the arch indexed in xlocate
env:
PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
run: |
if [ -s /tmp/templates ]; then
xlocate -S &&
common/scripts/lint-conflicts $HOME/hostdir/binpkgs
fi

- name: Verify repository state
run: |
(
here="$(pwd)"
cd /
"$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
)
18 changes: 18 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .github/workflows/sync.yml
name: Rebase Upstream
on:
schedule:
- cron: '0 */6 * * *' # Run every 6 hours
workflow_dispatch: # run manually

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 9999 # greater than the number of commits you made
- uses: imba-tjd/rebase-upstream-action@master
with:
upstream: void-linux/void-packages
branch: master
58 changes: 58 additions & 0 deletions .github/workflows/update_master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'Sync master branch with upstream'

on:
schedule:
- cron: '0 7 * * *'
# scheduled at 07:00 every Monday and Thursday

workflow_dispatch: # click the button on Github repo!
inputs:
sync_test_mode: # Adds a boolean option that appears during manual workflow run for easy test mode config
description: 'Fork Sync Test Mode'
type: boolean
default: false

jobs:
sync_latest_from_upstream:
runs-on: ubuntu-latest
name: Sync latest commits from upstream repo

steps:
# REQUIRED step
# Step 1: run a standard checkout action, provided by github
- name: Checkout target repo
uses: actions/checkout@v3
with:
# optional: set the branch to checkout,
# sync action checks out your 'target_sync_branch' anyway
ref: master
# REQUIRED if your upstream repo is private (see wiki)
persist-credentials: false

# REQUIRED step
# Step 2: run the sync action
- name: Sync upstream changes
id: sync
uses: aormsby/[email protected]
with:
target_sync_branch: master
# REQUIRED 'target_repo_token' exactly like this!
target_repo_token: ${{ secrets.GITHUB_TOKEN }}
upstream_sync_branch: master
upstream_sync_repo: void-linux/void-packages
#upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }}

# Set test_mode true during manual dispatch to run tests instead of the true action!!
test_mode: ${{ inputs.sync_test_mode }}

# Step 3: Display a sample message based on the sync output var 'has_new_commits'
- name: New commits found
if: steps.sync.outputs.has_new_commits == 'true'
run: echo "New commits were found to sync."

- name: No new commits
if: steps.sync.outputs.has_new_commits == 'false'
run: echo "There were no new commits."

- name: Show value of 'has_new_commits'
run: echo ${{ steps.sync.outputs.has_new_commits }}