Skip to content

Commit af82105

Browse files
committed
download external files to successfully complete task go:vet
1 parent 95b2356 commit af82105

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.github/workflows/check-go-task.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ jobs:
8080
repo-token: ${{ secrets.GITHUB_TOKEN }}
8181
version: 3.x
8282

83+
- name: Download external files
84+
run: |
85+
task download-dfu-util
86+
task download-libusb
87+
8388
- name: Check for errors
8489
env:
8590
GO_MODULE_PATH: ${{ matrix.module.path }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dfu-discovery
55
*.o
66
dfu-util_*.c
77
dist/
8+
libusb.h

Taskfile.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ vars:
2727
-X {{.CONFIGURATION_PACKAGE}}.Timestamp={{.TIMESTAMP}}
2828
'
2929
DFU_UTIL_VERSION: dfu-util-0.11
30+
LIBUSB_VERSION: libusb-1.0.26
3031
# Path of the project's primary Go module:
3132
DEFAULT_GO_MODULE_PATH: ./
3233
DEFAULT_GO_PACKAGES:
@@ -55,6 +56,19 @@ tasks:
5556
# for some reason quirks.c has the exec flag set
5657
chmod -x dfu-util_quirks.c
5758
fi
59+
60+
download-libusb:
61+
desc: download libusb and copy the files in the correct dir
62+
cmds:
63+
- |
64+
if [ -d "{{.LIBUSB_VERSION}}" ];
65+
then
66+
echo "{{.LIBUSB_VERSION}} already downloaded (directory exists)."
67+
else
68+
echo "Downloading {{.LIBUSB_VERSION}}..."
69+
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 -s | tar xj
70+
cp {{.LIBUSB_VERSION}}/libusb/libusb.h .
71+
fi
5872
5973
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-dependencies-task/Taskfile.yml
6074
general:prepare-deps:

0 commit comments

Comments
 (0)