feat: add basic CI
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.{yml,yaml,toml,js}]
|
||||||
|
indent_size = 2
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
|
||||||
|
- name: Get sample PKGBUILD
|
||||||
|
run: wget https://github.com/official-human/nonicons-font/raw/main/PKGBUILD
|
||||||
|
|
||||||
|
- name: Test actions
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
updpkgsums: true
|
||||||
|
srcinfo: true
|
||||||
+12
-2
@@ -1,7 +1,17 @@
|
|||||||
FROM alpine:3.10
|
# Base image
|
||||||
|
FROM docker.io/library/archlinux:base-devel
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN pacman -Syu --needed --noconfirm pacman-contrib namcap
|
||||||
|
|
||||||
|
# Setup user
|
||||||
|
RUN useradd -m builder \
|
||||||
|
usermod -aG wheel builder \
|
||||||
|
echo 'wheel ALL=(ALL:ALL) ALL' >> /etc/sudoers
|
||||||
|
|
||||||
|
# Copy files
|
||||||
COPY LICENSE README.md /
|
COPY LICENSE README.md /
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
# Set entrypoint
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
+35
-10
@@ -1,12 +1,37 @@
|
|||||||
name: 'Container Action Template'
|
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
|
||||||
description: 'Get started with Container actions'
|
name: "Arch Linux's package action"
|
||||||
author: 'GitHub'
|
description: "GitHub Action to run Arch Linux's package tools"
|
||||||
inputs:
|
author: "datakrama"
|
||||||
myInput:
|
branding:
|
||||||
description: 'Input to use'
|
icon: "package"
|
||||||
default: 'world'
|
color: "green"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: "Location for this action to run"
|
||||||
|
default: $GITHUB_WORKSPACE
|
||||||
|
required: false
|
||||||
|
updpkgsums:
|
||||||
|
description: "Update checksums on PKGBUILD"
|
||||||
|
default: "false"
|
||||||
|
required: false
|
||||||
|
srcinfo:
|
||||||
|
description: "Generate new .SRCINFO"
|
||||||
|
default: "false"
|
||||||
|
required: false
|
||||||
|
flags:
|
||||||
|
description: "Extra flags for makepkg"
|
||||||
|
default: "-cfs --noconfirm"
|
||||||
|
required: false
|
||||||
|
namcap:
|
||||||
|
description: "Validate package with namcap"
|
||||||
|
default: "true"
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: "docker"
|
||||||
image: 'Dockerfile'
|
image: "Dockerfile"
|
||||||
args:
|
args:
|
||||||
- ${{ inputs.myInput }}
|
- ${{ inputs.updpkgsums }}
|
||||||
|
- ${{ inputs.flags }}
|
||||||
|
- ${{ inputs.namcap }}
|
||||||
|
|||||||
+21
-1
@@ -1,3 +1,23 @@
|
|||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
|
||||||
echo "hello $1"
|
cd $INPUT_PATH
|
||||||
|
|
||||||
|
if [[ $INPUT_UPDPKGSUMS == true ]]; then
|
||||||
|
echo "Update checksums on PKGBUILD"
|
||||||
|
updpkgsums
|
||||||
|
git diff PKGBUILD
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $INPUT_SRCINFO == true ]]; then
|
||||||
|
echo "Generate new .SRCINFO based on PKGBUILD"
|
||||||
|
sudo -u builder makepkg --printsrcinfo > .SRCINFO
|
||||||
|
git diff .SRCINFO
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Run makepkg with flags"
|
||||||
|
sudo -u builder makepkg $INPUT_FLAGS
|
||||||
|
|
||||||
|
if [[ $INPUT_NAMCAP == true ]]; then
|
||||||
|
echo "Validate PKGBUILD with namcap"
|
||||||
|
namcap -i PKGBUILD
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user