mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-09-11 15:56:04 +03:00
Added PKGBUILD building tests as GitHub Action
This commit is contained in:
parent
873bb550a2
commit
ff8c57223e
50
.github/workflows/PKGBUILD-builds.yml
vendored
Normal file
50
.github/workflows/PKGBUILD-builds.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: Check PKGBUILD builds for Arch.
|
||||
|
||||
# Controls when the workflow will run
|
||||
on:
|
||||
# Triggers the workflow on push or pull request events but only for the main branch
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
PKGBUILD-build:
|
||||
container: archlinux:base-devel
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
version: [PKGBUILD, PKGBUILD-git]
|
||||
steps:
|
||||
- name: Install packages
|
||||
run: |
|
||||
pacman-key --init
|
||||
pacman -Sy
|
||||
|
||||
- name: Add builduser
|
||||
run: |
|
||||
# Create the builduser
|
||||
useradd builduser -m
|
||||
# Delete the buildusers password
|
||||
passwd -d builduser
|
||||
# Allow the builduser passwordless sudo
|
||||
printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers
|
||||
|
||||
- name: Check out sources
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Test ${{ matrix.version }}
|
||||
run: |
|
||||
file="${{ matrix.version }}"
|
||||
build_dir="/tmp/$file/"
|
||||
cd build-scripts
|
||||
mkdir $build_dir
|
||||
cp ./$file $build_dir/PKGBUILD
|
||||
cd $build_dir
|
||||
sudo chown builduser $build_dir
|
||||
sudo -H -u builduser bash -c 'makepkg -s --noconfirm'
|
Loading…
Reference in New Issue
Block a user