forked from RFD-FHEM/RFFHEM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'RFD-FHEM:master' into master
- Loading branch information
Showing
29 changed files
with
3,171 additions
and
1,001 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
# We need to fetch with a depth of 2 for pull_request so we can do HEAD^2 | ||
fetch-depth: 2 | ||
|
@@ -22,15 +22,25 @@ jobs: | |
- name: "[Push] Get commit message" | ||
if: github.event_name == 'push' | ||
id: push_get_commit_message | ||
run: | ||
echo ::set-output name=push_commit_message::$(git log --format=%B -n 1 HEAD) | ||
run: | | ||
{ | ||
echo 'pr_commit_message<<EOF' | ||
git log --format=%B -n 1 HEAD | ||
echo EOF | ||
} >> $GITHUB_OUTPUT | ||
# If this workflow was triggered by a pull request (open or synchronize!) then resolve the commit message from HEAD^2 | ||
# It is stored in output steps, to be referenced with ${{ steps.pr_get_commit_message.outputs.pr_commit_message }} | ||
- name: "[Pull Request] Get commit message" | ||
if: github.event_name == 'pull_request' | ||
id: pr_get_commit_message | ||
run: echo ::set-output name=pr_commit_message::$(git log --format=%B -n 1 HEAD^2) | ||
run: | | ||
{ | ||
echo 'pr_commit_message<<EOF' | ||
git log --format=%B -n 1 HEAD^2 | ||
echo EOF | ||
} >> $GITHUB_OUTPUT | ||
# Finally we want to make the commit message available to other jobs. This can be done with job-level outputs | ||
# However as we do not know whether the commit message was set in Push or Pull Request event we need to do some | ||
|
@@ -54,59 +64,43 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- id: file_changes | ||
uses: trilom/[email protected] | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
output: ',' | ||
json: true | ||
quotepath: false | ||
files: | | ||
FHEM/**.pm | ||
FHEM/lib/**.pm | ||
lib/FHEM/**.pm | ||
- name: Get current date | ||
id: date | ||
run: | | ||
echo "::set-output name=date::$(date -u +'%Y%m%d')" | ||
echo "::set-output name=datetimestr::$(date -u +'%Y-%m-%d %T')" | ||
echo "date=$(date -u +'%Y%m%d')" >> $GITHUB_OUTPUT | ||
echo "datetimestr=$(date -u +'%Y-%m-%d %T')" >> $GITHUB_OUTPUT | ||
- name: Set matrix for build | ||
id: set-matrix | ||
if: ${{ github.event.sender != 'actions-user' }} | ||
run: | | ||
JSON="{\"include\":[" | ||
# Loop by lines | ||
IFS=, read -ra values <<< "${{ steps.file_changes.outputs.files_modified}},${{ steps.file_changes.outputs.files_added}}" | ||
for v in "${values[@]}" | ||
do | ||
# Exclude non pm files | ||
if [[ "$v" != *.pm ]]; then | ||
continue | ||
fi; | ||
# Add build to the matrix only if it is not already included | ||
JSONline="{\"file\": \"$v\"}," | ||
if [[ "$JSON" != *"$JSONline"* ]]; then | ||
JSON="$JSON$JSONline" | ||
fi | ||
done | ||
# Remove last "," and add closing brackets | ||
if [[ $JSON == *, ]]; then | ||
JSON="${JSON%?}" | ||
fi | ||
JSON="$JSON]}" | ||
echo $JSON | ||
run: | ||
echo "matrix={\"files\":${{ steps.file_changes.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" | ||
|
||
# Set output | ||
echo "::set-output name=matrix::$( echo "$JSON" )" | ||
modify: | ||
if: ${{ fromJSON( needs.metadata.outputs.matrix ).include[0] }} | ||
if: ${{ fromJSON( needs.metadata.outputs.matrix ).files[0] }} | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
needs: metadata | ||
strategy: | ||
matrix: ${{ fromJson(needs.metadata.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Find Version String | ||
if: endsWith(matrix.file, '00_SIGNALduino.pm') | ||
if: endsWith(matrix.files, '00_SIGNALduino.pm') | ||
id: versionList | ||
uses: nguyenvanuyn96/str-find-action@master | ||
with: | ||
find: '\d\.\d\.\d' | ||
include: "${{ matrix.file }}" | ||
include: "${{ matrix.files }}" | ||
- uses: jungwinter/split@v2 | ||
name: Split array result | ||
if: ${{ steps.versionList.outputs.fileFoundCount > 0 }} | ||
|
@@ -120,48 +114,56 @@ jobs: | |
with: | ||
find: \w+\s+=>\s\'\d.\d.\d\+\d+\' | ||
replace: "SDUINO_VERSION => '${{ steps.versions.outputs._1 }}+${{ needs.metadata.outputs.date }}'" | ||
include: "${{ matrix.file }}" | ||
include: "${{ matrix.files }}" | ||
- name: Update Date in ID line | ||
uses: jacobtomlinson/[email protected] | ||
with: | ||
find: \d\d\d\d-\d\d-\d\d\s\d\d:\d\d:\d\dZ\s[\w|-]+\s | ||
replace: "${{ needs.metadata.outputs.datetime }}Z ${{ github.event.pull_request.user.login }} " | ||
include: "${{ matrix.file }}" | ||
include: "${{ matrix.files }}" | ||
- name: Artifactname | ||
env: | ||
ARTIFACT_NAME: "${{ matrix.files }}" | ||
run: | | ||
ARTIFACT_NAME=${{ env.ARTIFACT_NAME }} | ||
ARTIFACT_NAME=$(basename $ARTIFACT_NAME) # get only the filename and use this as artifact name | ||
echo ARTIFACT_NAME=${ARTIFACT_NAME} >> $GITHUB_ENV # update GitHub ENV vars | ||
- name: Save updated Files in artifacts | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: updated-files | ||
name: ${{ env.ARTIFACT_NAME }} | ||
retention-days: 1 | ||
path: | | ||
${{ matrix.file }} | ||
${{ matrix.files }} | ||
commit: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: modify | ||
name: Commit and Push back | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Download all modified artifacts | ||
uses: actions/download-artifact@v3 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ${{ github.workspace }} | ||
path: ${{ github.workspace }}/artifacts | ||
|
||
- name: replace files from artifacts | ||
run: | | ||
for FPATH in ./updated-files/*.pm; do | ||
for FPATH in ./artifacts/*/*.pm; do | ||
FILE=$(basename $FPATH) | ||
find ./FHEM -name "$FILE" -exec cp $FPATH "{}" \; | ||
done | ||
- name: update controls file (FHEM) | ||
uses: fhem/fhem-controls-actions@v2.2.0 | ||
uses: fhem/fhem-controls-actions@V2.2.1 | ||
with: | ||
filename: controls_signalduino.txt | ||
- name: update controls file (lib) | ||
uses: fhem/fhem-controls-actions@v2.2.0 | ||
uses: fhem/fhem-controls-actions@V2.2.1 | ||
with: | ||
filename: controls_signalduino.txt | ||
directory: FHEM/lib | ||
|
@@ -171,11 +173,11 @@ jobs: | |
run: | | ||
git config --global user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "Update Versiondate" -a && echo "::set-output name=status::true" || true | ||
git commit -m "Update Versiondate" -a && echo "status=true" >> $GITHUB_OUTPUT || true | ||
- name: Wait for tests to succeed | ||
if: ${{ steps.commit.outputs.status }} | ||
uses: lewagon/[email protected].1 | ||
uses: lewagon/[email protected].3 | ||
with: | ||
running-workflow-name: 'Commit and Push back' | ||
ref: ${{ github.head_ref }} | ||
|
@@ -185,7 +187,7 @@ jobs: | |
|
||
- name: git push | ||
if: ${{ steps.commit.outputs.status }} | ||
uses: ad-m/github-push-action@v0.6.0 | ||
uses: ad-m/github-push-action@v0.8.0 | ||
with: | ||
github_token: ${{ secrets.GH_TOKEN }} | ||
branch: ${{ github.head_ref }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cover_db/ | ||
.vscode | ||
jsonExtract.pl | ||
errorformat | ||
errorformat.small | ||
docker_test.sh | ||
testOutput.* | ||
memleak.pl | ||
t/FHEM/global/* | ||
lib/Test2/Formatter/gha.pm | ||
bin/reviewdog | ||
workspace.code-workspace | ||
.vstags |
Oops, something went wrong.