Skip to content

Commit 78c8d43

Browse files
committed
Move tester build generation to dedicated workflow
This process had no business being in the unit test runner workflow, not being related to the running of unit tests.
1 parent 683d54e commit 78c8d43

File tree

3 files changed

+110
-82
lines changed

3 files changed

+110
-82
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/publish-go-tester-task.md
2+
name: Publish Tester Build
3+
4+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
5+
on:
6+
push:
7+
paths:
8+
- ".github/workflows/publish-go-tester-task.ya?ml"
9+
- "go.mod"
10+
- "go.sum"
11+
- "Taskfile.ya?ml"
12+
- "**.go"
13+
pull_request:
14+
paths:
15+
- ".github/workflows/publish-go-tester-task.ya?ml"
16+
- "go.mod"
17+
- "go.sum"
18+
- "Taskfile.ya?ml"
19+
- "**.go"
20+
workflow_dispatch:
21+
repository_dispatch:
22+
23+
env:
24+
# As defined by the Taskfile's DIST_DIR variable
25+
DIST_DIR: dist
26+
BUILDS_ARTIFACT: build-artifacts
27+
28+
jobs:
29+
build:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v2
35+
with:
36+
fetch-depth: 0
37+
38+
- name: Install Taskfile
39+
uses: arduino/setup-task@v1
40+
with:
41+
repo-token: ${{ secrets.GITHUB_TOKEN }}
42+
version: 3.x
43+
44+
- name: Build
45+
run: |
46+
PACKAGE_NAME_PREFIX="${{ github.workflow }}"
47+
if [ "${{ github.event_name }}" = "pull_request" ]; then
48+
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
49+
fi
50+
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
51+
export PACKAGE_NAME_PREFIX
52+
task dist:all
53+
54+
# Transfer builds to artifacts job
55+
- name: Upload combined builds artifact
56+
uses: actions/upload-artifact@v2
57+
with:
58+
path: ${{ env.DIST_DIR }}
59+
name: ${{ env.BUILDS_ARTIFACT }}
60+
61+
artifacts:
62+
name: ${{ matrix.artifact.name }} artifact
63+
needs: build
64+
runs-on: ubuntu-latest
65+
66+
strategy:
67+
matrix:
68+
artifact:
69+
- path: "*checksums.txt"
70+
name: checksums
71+
- path: "*Linux_32bit.tar.gz"
72+
name: Linux_X86-32
73+
- path: "*Linux_64bit.tar.gz"
74+
name: Linux_X86-64
75+
- path: "*Linux_ARM64.tar.gz"
76+
name: Linux_ARM64
77+
- path: "*Linux_ARMv6.tar.gz"
78+
name: Linux_ARMv6
79+
- path: "*Linux_ARMv7.tar.gz"
80+
name: Linux_ARMv7
81+
- path: "*macOS_64bit.tar.gz"
82+
name: macOS_64
83+
- path: "*Windows_32bit.zip"
84+
name: Windows_X86-32
85+
- path: "*Windows_64bit.zip"
86+
name: Windows_X86-64
87+
88+
steps:
89+
- name: Download combined builds artifact
90+
uses: actions/download-artifact@v2
91+
with:
92+
name: ${{ env.BUILDS_ARTIFACT }}
93+
path: ${{ env.BUILDS_ARTIFACT }}
94+
95+
- name: Upload individual build artifact
96+
uses: actions/upload-artifact@v2
97+
with:
98+
path: ${{ env.BUILDS_ARTIFACT }}/${{ matrix.artifact.path }}
99+
name: ${{ matrix.artifact.name }}
100+
101+
clean:
102+
needs: artifacts
103+
runs-on: ubuntu-latest
104+
105+
steps:
106+
- name: Remove unneeded combined builds artifact
107+
uses: geekyeggo/delete-artifact@v1
108+
with:
109+
name: ${{ env.BUILDS_ARTIFACT }}

.github/workflows/test.yml

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -57,85 +57,3 @@ jobs:
5757
file: ./coverage_unit.txt
5858
flags: unit
5959
fail_ci_if_error: true
60-
61-
build:
62-
runs-on: ubuntu-latest
63-
64-
steps:
65-
- name: Checkout repository
66-
uses: actions/checkout@v1
67-
with:
68-
fetch-depth: 0
69-
70-
- name: Install Taskfile
71-
uses: arduino/setup-task@v1
72-
with:
73-
repo-token: ${{ secrets.GITHUB_TOKEN }}
74-
version: 3.x
75-
76-
- name: Build
77-
run: |
78-
PACKAGE_NAME_PREFIX="${{ github.workflow }}"
79-
if [ "${{ github.event_name }}" = "pull_request" ]; then
80-
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
81-
fi
82-
PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}-"
83-
export PACKAGE_NAME_PREFIX
84-
task dist:all
85-
86-
# Transfer builds to artifacts job
87-
- name: Upload combined builds artifact
88-
uses: actions/upload-artifact@v2
89-
with:
90-
path: dist/
91-
name: ${{ env.BUILDS_ARTIFACT }}
92-
93-
artifacts:
94-
name: ${{ matrix.artifact.name }} artifact
95-
needs: build
96-
runs-on: ubuntu-latest
97-
98-
strategy:
99-
matrix:
100-
artifact:
101-
- path: "*checksums.txt"
102-
name: checksums
103-
- path: "*Linux_32bit.tar.gz"
104-
name: Linux_X86-32
105-
- path: "*Linux_64bit.tar.gz"
106-
name: Linux_X86-64
107-
- path: "*Linux_ARM64.tar.gz"
108-
name: Linux_ARM64
109-
- path: "*Linux_ARMv6.tar.gz"
110-
name: Linux_ARMv6
111-
- path: "*Linux_ARMv7.tar.gz"
112-
name: Linux_ARMv7
113-
- path: "*macOS_64bit.tar.gz"
114-
name: macOS_64
115-
- path: "*Windows_32bit.zip"
116-
name: Windows_X86-32
117-
- path: "*Windows_64bit.zip"
118-
name: Windows_X86-64
119-
120-
steps:
121-
- name: Download combined builds artifact
122-
uses: actions/download-artifact@v2
123-
with:
124-
name: ${{ env.BUILDS_ARTIFACT }}
125-
path: ${{ env.BUILDS_ARTIFACT }}
126-
127-
- name: Upload individual build artifact
128-
uses: actions/upload-artifact@v2
129-
with:
130-
path: ${{ env.BUILDS_ARTIFACT }}/${{ matrix.artifact.path }}
131-
name: ${{ matrix.artifact.name }}
132-
133-
clean:
134-
needs: artifacts
135-
runs-on: ubuntu-latest
136-
137-
steps:
138-
- name: Remove unneeded combined builds artifact
139-
uses: geekyeggo/delete-artifact@v1
140-
with:
141-
name: ${{ env.BUILDS_ARTIFACT }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Test Integration status](https://github.com/arduino/arduino-lint/actions/workflows/test-go-integration-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/test-go-integration-task.yml)
55
[![Check Go status](https://github.com/arduino/arduino-lint/actions/workflows/check-go-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/check-go-task.yml)
66
[![Check Code Generation status](https://github.com/arduino/arduino-lint/actions/workflows/check-code-generation-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/check-code-generation-task.yml)
7+
[![Publish Tester Build status](https://github.com/arduino/arduino-lint/actions/workflows/publish-go-tester-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/publish-go-tester-task.yml)
78
[![Publish Nightly Build status](https://github.com/arduino/arduino-lint/actions/workflows/publish-go-nightly-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/publish-go-nightly-task.yml)
89
[![Check Python status](https://github.com/arduino/arduino-lint/actions/workflows/check-python-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/check-python-task.yml)
910
[![Check Markdown status](https://github.com/arduino/arduino-lint/actions/workflows/check-markdown-task.yml/badge.svg)](https://github.com/arduino/arduino-lint/actions/workflows/check-markdown-task.yml)

0 commit comments

Comments
 (0)