Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dce3350
add ci and scripts
lucarin91 Oct 15, 2025
f59da7b
add task to go.mod
lucarin91 Oct 15, 2025
a6bbbe1
remove codeowner
lucarin91 Oct 15, 2025
2a52967
update licenses config
lucarin91 Oct 15, 2025
a82272c
Update .editorconfig
lucarin91 Oct 15, 2025
e9cea9f
Update .editorconfig
lucarin91 Oct 15, 2025
2d32bd5
Update dprint.json
lucarin91 Oct 15, 2025
37d75e5
Update dprint.json
lucarin91 Oct 15, 2025
3041752
Update dprint.json
lucarin91 Oct 15, 2025
0db61e5
Update Taskfile.yml
lucarin91 Oct 15, 2025
2a76633
Update Taskfile.yml
lucarin91 Oct 15, 2025
178ed6e
Update Taskfile.yml
lucarin91 Oct 15, 2025
2efb8c0
remove license version
lucarin91 Oct 15, 2025
1ae1e3a
add review license
lucarin91 Oct 15, 2025
eca4106
Update .github/workflows/release.yml
lucarin91 Oct 15, 2025
948b2c2
update dprint
lucarin91 Oct 15, 2025
4179ed7
add license
lucarin91 Oct 15, 2025
f0c28c0
update linter version on ci
lucarin91 Oct 15, 2025
644fc6c
Merge remote-tracking branch 'origin/main' into add-ci-stuff
lucarin91 Oct 15, 2025
b234e3f
make fmt happy
lucarin91 Oct 15, 2025
7875f16
Update .github/workflows/release.yml
lucarin91 Oct 15, 2025
08f326b
Update .licensed.yml
lucarin91 Oct 16, 2025
648d4e1
Remove reviewed dependencies from .licensed.yml
dido18 Oct 17, 2025
e7effbb
Remove obsolete dependency license files for updater
dido18 Oct 17, 2025
ceb9b6f
Remove hardcoded Go version and use go.mod for versioning in workflows
dido18 Oct 20, 2025
705d045
fixup! Remove hardcoded Go version and use go.mod for versioning in w…
lucarin91 Oct 20, 2025
1f77d10
fixup! fixup! Remove hardcoded Go version and use go.mod for versioni…
lucarin91 Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Default configuration for all files
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

# Use utf-8 charset for modern languages
[*.{go}]
charset = utf-8

# Use tab indentation for Go and Makefiles
[{*.go,go.*}]
indent_style = tab
indent_size = 4

19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Motivation

<!-- Why this pull request? -->

### Change description

<!-- What does your code do? -->

### Additional Notes

<!-- Link any useful metadata: Jira task, GitHub issue, ... -->

### Reviewer checklist

- [ ] PR addresses a single concern.
- [ ] PR title and description are properly filled.
- [ ] Changes will be merged in `main`.
- [ ] Changes are covered by tests.
- [ ] Logging is meaningful in case of troubleshooting.
20 changes: 20 additions & 0 deletions .github/workflows/block-merge-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Block Merge if "do-not-merge" Label Exists

on:
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize # important for when new commits are pushed

jobs:
check-do-not-merge-label:
runs-on: ubuntu-latest
steps:
- name: Check for "do-not-merge" label
if: contains(github.event.pull_request.labels.*.name, 'do-not-merge')
run: |
echo "This Pull Request has the 'do-not-merge' label. Merging is blocked."
echo "Please remove the 'do-not-merge' label to enable merging."
exit 1 # This will cause the workflow to fail
155 changes: 155 additions & 0 deletions .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md
name: Check Go Dependencies

# See: https://docs.github.com/actions/reference/workflows-and-actions/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-go-dependencies-task.ya?ml"
- ".licenses/**"
- ".licensed.json"
- ".licensed.ya?ml"
- "Taskfile.ya?ml"
- "**/.gitmodules"
- "**/go.mod"
- "**/go.sum"
pull_request:
paths:
- ".github/workflows/check-go-dependencies-task.ya?ml"
- ".licenses/**"
- ".licensed.json"
- ".licensed.ya?ml"
- "Taskfile.ya?ml"
- "**/.gitmodules"
- "**/go.mod"
- "**/go.sum"
schedule:
# Run periodically to catch breakage caused by external changes.
- cron: "0 8 * * WED"
workflow_dispatch:
repository_dispatch:

jobs:
run-determination:
runs-on: ubuntu-latest
permissions: {}
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
- name: Determine if the rest of the workflow should run
id: determination
run: |
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
if [[
"${{ github.event_name }}" != "create" ||
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
]]; then
# Run the other jobs.
RESULT="true"
else
# There is no need to run the other jobs.
RESULT="false"
fi
echo "result=$RESULT" >>$GITHUB_OUTPUT
check-cache:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive

# This is required to allow licensee/setup-licensed to install Licensed via Ruby gem.
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Install latest version

- name: Install licensed
uses: licensee/setup-licensed@v1.3.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 5.x

- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Update dependencies license metadata cache
run: |
go tool \
github.com/go-task/task/v3/cmd/task \
--silent \
general:cache-dep-licenses
- name: Check for outdated cache
id: diff
run: |
git add .
if
! git diff \
--cached \
--color \
--exit-code
then
echo
echo "::error::Dependency license metadata out of sync. See: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md#metadata-cache"
exit 1
fi
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
- name: Upload cache to workflow artifact
if: failure() && steps.diff.outcome == 'failure'
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
include-hidden-files: true
name: dep-licenses-cache
path: .licenses/

check-deps:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: recursive

# This is required to allow licensee/setup-licensed to install Licensed via Ruby gem.
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby # Install latest version

- name: Install licensed
uses: licensee/setup-licensed@v1.3.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 5.x

- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Check for dependencies with unapproved licenses
run: |
go tool \
github.com/go-task/task/v3/cmd/task \
--silent \
general:check-dep-licenses
38 changes: 38 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run Checks

on:
push:
branches: [main]
pull_request:
branches: [main]

# In the same branch only 1 workflow per time can run. In case we're not in the
# main branch we cancel previous running workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions:
contents: read
# Used by the buf to create a comment with a brief summary of failing tets
pull-requests: write

jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dprint/check@v2.2
with:
dprint-version: 0.50.2

- uses: golangci/golangci-lint-action@v8
with:
version: v2.5.0
args: --timeout 300s

- name: Check go mod
run: |
go mod tidy
git diff --color --exit-code
22 changes: 22 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Go Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
go-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run tests
run: go tool task test
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release releaser

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

env:
PROJECT_NAME: "releaser"
GITHUB_TOKEN: ${{ secrets.ARDUINOBOT_TOKEN }}
GITHUB_USERNAME: ArduinoBot

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Extract version
shell: bash
run: |
VERSION="${GITHUB_REF##*/}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "RELEASE_NAME=${{ env.PROJECT_NAME }}-${VERSION}-linux-amd64" >> $GITHUB_ENV
env:
GITHUB_REF: ${{ github.ref }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build Binary
env:
GOARCH: ${{ matrix.arch }}
GOOS: ${{ matrix.os }}
run: |
mkdir -p build/
go build -v -ldflags "-X 'main.version=${{ env.VERSION }}'" \
-o ./build/ \
./cmd/${{ env.PROJECT_NAME }}

- name: Prepare Build Artifacts
run: |
tar -czf ./build/${{ env.RELEASE_NAME }}.tar.gz -C ./build ${{ env.PROJECT_NAME }}

- name: Upload artifacts index
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: true
artifacts: build/${{ env.RELEASE_NAME }}.tar.gz
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.bin/

build/

# ignore macOS system files
.DS_Store

Loading