Skip to content

Commit

Permalink
github: sync changes from main
Browse files Browse the repository at this point in the history
  • Loading branch information
pktpls committed Dec 7, 2024
1 parent b7859b3 commit 81ab3be
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 92 deletions.
48 changes: 41 additions & 7 deletions .github/issue_template
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
Please make sure that the issue subject starts with `<package-name>: `
# Vorlage für einen Bugreport

# Issue template (remove lines from top till here)
English version below.

Maintainer: @\<github-user> (find it by checking history of the package Makefile)
Environment: (put here arch, model, OpenWrt version)
Bitte benenne deinen Bugreport in etwa so: `<package-name>: `
Wenn du den Namen des Pakets nicht kennst, bei dem der Fehler auftritt, versuche bitte,
eine andere sinnvolle Überschrift zu finden.

Description:
Dein Bericht kann uns am meisten weiterhelfen, wenn du uns so viele Informationen
wie möglich gibst. Bitte gib uns mindestens diese Infos:

```
Formating code blocks by wrapping them with pairs of ```
- Falter-Firmware Version
- Was hast du gemacht, unmittelbar bevor dir der Fehler aufgefallen ist? Wie können wir das nachstellen?
- Hast du auf deinem Router eine spezielle Konfiguration? (Irgendetwas, außer einfach nur den Einrichtungs-Wizard durchgehen?)

Bitte schreibe deinen Report auf Englisch oder Deutsch. Nimm gerne die Sprache, mit der du dich wohler fühlst.

## Issue template

Please try to start the issue subject similar to `<package-name>: `
If you don't know the package name, please make sure at least, that you use a
meaningful headline.

Your Issue is most useful to us, if you provide as much information as you
can. Please give at least these information:

- Falter-Firmware version
- What did you do, before you get known of the bug? How could we reproduce this?
- Did you configure something special on your router? (Anything other than just running the wizard?)

Feel free to either write your report in English or German. Whichever you feel more comfortable with.

---------- Bitte entferne alles oberhalb dieser Zeilen --------
---------- Please remove everything above these lines ---------
--------------------- snip / schnipp --------------------------

Falter Firmware Version:

Special config/Besondere Einstellungen:

Description/Beschreibung:

```text
You can include code blocks by wrapping them with pairs of backticks (```)
Du kannst Codeblocks erstellen, indem du den Code mit Backticks (```) umschließt.
```
21 changes: 17 additions & 4 deletions .github/pull_request_template
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
Maintainer: me / @\<github-user> (find it by checking history of the package Makefile)
Compile tested: (put here arch, model, OpenWrt version)
Run tested: (put here arch, model, OpenWrt version, tests done)
# Pull Request Vorlage / Template

Description:
Bitte die nicht-benutzte Sprachversion entfernen.
Please remove the Language version of this template, which you don't use.

------------ schnipp /snip ------------

Kompiliert Ja/Nein: (Bitte gib Prozessorarchitektur, Modell und Falter/OpenWrtversion an)
Läuft live Ja/Nein: (Bitte gib Prozessorarchitektur, Modell und Falter/OpenWrtversion an und wie du deine Änderungen getestet hast)

Beschreibung deiner Änderungen:

----------

Compile tested: (put here arch, model, Falter (_OpenWrt_) version)
Run tested: (put here arch, model, Falter (_OpenWrt_) version, tests done)

Description of your changes:
2 changes: 1 addition & 1 deletion .github/workflows/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for PKG in /ci/*.ipk; do
if [ -f "$TEST_SCRIPT" ]; then
echo "Use package specific test.sh"
if sh "$TEST_SCRIPT" "$PKG_NAME" "$PKG_VERSION"; then
echo "Test succesful"
echo "Test successful"
else
echo "Test failed"
exit 1
Expand Down
52 changes: 24 additions & 28 deletions .github/workflows/formal.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@
---
name: Test Formalities
on: [pull_request] # yamllint disable-line rule:truthy
name: lint

on: [push, pull_request]

jobs:
build:
name: Test Formalities
name: formalities
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0

- name: Determine branch name
run: |
# shellcheck disable=SC2030
BRANCH="${GITHUB_BASE_REF#refs/heads/}"
echo "Building for $BRANCH"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >>"$GITHUB_ENV"
- name: Test formalities
run: |
# shellcheck disable=SC1091
source .github/workflows/ci_helpers.sh
RET=0
for commit in $(git rev-list HEAD ^origin/$BRANCH); do
info "=== Checking commit '$commit'"
if git show --format='%P' -s $commit | grep -qF ' '; then
err "Pull request should not include merge commits"
RET=1
fi
subject="$(git show -s --format=%s $commit)"
if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then
success "Commit subject line seems ok ($subject)"
else
err "Commit subject line MUST start with '<package name>: ' ($subject)"
RET=1
fi
body="$(git show -s --format=%b $commit)"
sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
if echo "$body" | grep -qF "$sob"; then
success "Signed-off-by match author"
else
err "Signed-off-by is missing or doesn't match author (should be '$sob')"
RET=1
fi
for commit in $(git rev-list HEAD ^origin/"$BRANCH"); do
info "=== Checking commit '$commit'"
if git show --format='%P' -s "$commit" | grep -qF ' '; then
err "Pull request should not include merge commits"
RET=1
fi
subject="$(git show -s --format=%s "$commit")"
if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then
success "Commit subject line seems ok ($subject)"
else
err "Commit subject line MUST start with '<package name>: ' ($subject)"
RET=1
fi
done
exit $RET
44 changes: 8 additions & 36 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,32 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base
name: lint

#
# Documentation:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on: [push, pull_request] # yamllint disable-line rule:truthy

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
name: lint
runs-on: ubuntu-latest

############################################
# Grant status permission for MULTI_STATUS #
############################################
permissions:
contents: read
packages: read
statuses: write

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
# Change to 'master' if your main branch differs
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Lint
run: |
sudo apt update
sudo apt install -y luarocks shellcheck
luarocks --local --tree $HOME/.luarocks install luacheck
make lint
85 changes: 69 additions & 16 deletions .github/workflows/multi-arch-test-build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
---
name: Test Build
on: [pull_request] # yamllint disable-line rule:truthy
name: test

on: # yamllint disable-line rule:truthy
pull_request:

jobs:
build:
name: Test ${{ matrix.arch }}
name: ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: mips_24kc
target: ath79-generic
- arch: mipsel_24kc
target: ramips-mt7621
runtime_test: false

- arch: aarch64_generic
target: armsr-armv8
runtime_test: false

- arch: x86_64
target: x86-64
runtime_test: true

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -23,16 +33,17 @@ jobs:
run: |
BRANCH="${GITHUB_BASE_REF#refs/heads/}"
echo "Building for $BRANCH"
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
echo "BRANCH=$BRANCH" >> "$GITHUB_ENV"
- name: Determine changed packages
run: |
# only detect packages with changes
PKG_ROOTS=$(find . -name Makefile | \
grep -v ".*/src/Makefile" | \
sed -e 's@./\(.*\)/Makefile@\1/@')
CHANGES=$(git diff --diff-filter=d --name-only origin/$BRANCH)
CHANGES=$(git diff --diff-filter=d --name-only "origin/$BRANCH...")
# shellcheck disable=SC2001
for ROOT in $PKG_ROOTS; do
for CHANGE in $CHANGES; do
if [[ "$CHANGE" == "$ROOT"* ]]; then
Expand All @@ -47,7 +58,7 @@ jobs:
PACKAGES="${PACKAGES:-luci-app-falter-owm}"
echo "Building $PACKAGES"
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
echo "PACKAGES=$PACKAGES" >> "$GITHUB_ENV"
- name: Build
uses: openwrt/gh-action-sdk@v7
Expand All @@ -58,17 +69,59 @@ jobs:
- name: Move created packages to project dir
run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true

- name: Collect metadata
run: |
MERGE_ID=$(git rev-parse --short HEAD)
# shellcheck disable=SC2129
echo "MERGE_ID=$MERGE_ID" >> "$GITHUB_ENV"
echo "BASE_ID=$(git rev-parse --short HEAD^1)" >> "$GITHUB_ENV"
echo "HEAD_ID=$(git rev-parse --short HEAD^2)" >> "$GITHUB_ENV"
PRNUMBER=${GITHUB_REF_NAME%/merge}
echo "PRNUMBER=$PRNUMBER" >> "$GITHUB_ENV"
echo "ARCHIVE_NAME=${{matrix.arch}}-PR$PRNUMBER-$MERGE_ID" >> "$GITHUB_ENV"
- name: Generate metadata
run: |
cat << _EOF_ > PKG-INFO
Metadata-Version: 2.1
Name: ${{env.ARCHIVE_NAME}}
Version: "$BRANCH"
Author: "$GITHUB_ACTOR"
Home-page: "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pull/$PRNUMBER"
Download-URL: "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
Summary: "$PACKAGES"
Platform: ${{ matrix.arch }}
Packages for OpenWrt $BRANCH running on ${{matrix.arch}}, built from PR $PRNUMBER
at commit $HEAD_ID, against $BRANCH at commit $BASE_ID, with merge SHA $MERGE_ID.
Modified packages:
_EOF_
for p in $PACKAGES
do
echo " $p" >> PKG-INFO
done
echo >> PKG-INFO
echo Full file listing: >> PKG-INFO
# shellcheck disable=SC2035
ls -al *.ipk >> PKG-INFO || true
cat PKG-INFO
- name: Store packages
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch}}-packages
path: "*.ipk"
name: ${{env.ARCHIVE_NAME}}-packages
path: |
*.ipk
PKG-INFO
- name: Store logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch}}-logs
path: logs/
name: ${{env.ARCHIVE_NAME}}-logs
path: |
logs/
PKG-INFO
- name: Remove logs
run: sudo rm -rf logs/ || true
Expand All @@ -83,9 +136,9 @@ jobs:
run: |
docker build -t test-container --build-arg ARCH .github/workflows/
env:
ARCH: ${{ matrix.arch }}
ARCH: ${{ matrix.arch }}-${{ env.BRANCH }}

- name: Test via Docker container
if: ${{ matrix.runtime_test }}
run: |
docker run --rm -v $GITHUB_WORKSPACE:/ci test-container
docker run --rm -v "$GITHUB_WORKSPACE":/ci test-container

0 comments on commit 81ab3be

Please sign in to comment.