Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0557de1

Browse files
committedApr 12, 2024
Test artifact creation
Fix workflow trigger Always run Change name Ignore branches Fix Test Test Fix repo owner Fix Workflow Fix workflow Fix command Test Fix Test Test Test Fix Test Fix Test
1 parent 7bb7270 commit 0557de1

File tree

3 files changed

+50
-5
lines changed

3 files changed

+50
-5
lines changed
 

‎.github/scripts/on-push.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -e
44

5-
export ARDUINO_BUILD_DIR="$HOME/.arduino/build.tmp"
6-
75
function build(){
86
local target=$1
97
local fqbn=$2

‎.github/workflows/pre-commit.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ on:
44
pull_request:
55
types: [opened, reopened, synchronize, labeled]
66

7+
concurrency:
8+
group: pre-commit-${{github.event.pull_request.number || github.ref}}
9+
cancel-in-progress: true
10+
711
jobs:
812
lint:
9-
if: |
10-
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge')
11-
name: Checking if any fixes are needed
13+
#if: ${{ contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') }}
14+
name: Run pre-commit hooks
1215
runs-on: ubuntu-latest
1316
steps:
1417
- name: Checkout latest commit
@@ -35,6 +38,39 @@ jobs:
3538
~/.cache/pip
3639
key: pre-commit|${{ env.PY_HASH }}|${{ hashFiles('.pre-commit-config.yaml', '.github/workflows/pre-commit.yml') }}
3740

41+
- name: Wait on other jobs to finish
42+
uses: lucasssvaz/wait-on-workflow@v1
43+
id: wait-on-jobs
44+
with:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
workflow_name: push.yml
47+
max_wait: 5
48+
interval: 30
49+
timeout: 7
50+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
51+
52+
- name: Download compilation artifacts
53+
uses: actions/download-artifact@v4
54+
if: ${{ steps.wait-on-jobs.outputs.run_id != '' }}
55+
with:
56+
pattern: build-job-*
57+
merge-multiple: true
58+
path: ~/.arduino/tests/
59+
run-id: ${{ env.RUNID }}
60+
github-token: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Merge compile commands
63+
if: ${{ steps.wait-on-jobs.outputs.run_id != '' }}
64+
run: |
65+
find ~/.arduino/tests/ -iname "compile_commands.json" | xargs jq -s 'map(.[])' > ~/compile_commands.json
66+
67+
- name: Upload compile commands
68+
if: ${{ steps.wait-on-jobs.outputs.run_id != '' }}
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: compile_commands
72+
path: ~/compile_commands.json
73+
3874
- name: Install python dependencies
3975
run: python -m pip install pre-commit docutils
4076

‎.github/workflows/push.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ jobs:
4848
- name: Build Sketches
4949
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} 15
5050

51+
- name: Upload artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: build-job-${{ matrix.chunk }}
55+
path: |
56+
~/.arduino/tests/**/*.h
57+
~/.arduino/tests/**/*.cpp
58+
~/.arduino/tests/**/*.bin
59+
~/.arduino/tests/**/compile_commands.json
60+
if-no-files-found: error
61+
5162
# Windows and MacOS
5263
build-arduino-win-mac:
5364
name: Arduino on ${{ matrix.os }}

0 commit comments

Comments
 (0)
Please sign in to comment.