Skip to content

bootstrap #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8da2419
bootstrap
alessio-perugini Jun 26, 2023
37dbd30
use arduino-cli executils
alessio-perugini Jul 3, 2023
be098c4
handle HID port address in get version
alessio-perugini Jul 3, 2023
dd8c096
improve the flash output messages
alessio-perugini Jul 3, 2023
0f33195
update relaxed-semver and the plugin-helper
alessio-perugini Jul 3, 2023
24ce6f6
use FindToolPath func to find espflash binary
alessio-perugini Jul 3, 2023
d91d2aa
update .gitignore
alessio-perugini Jul 5, 2023
2e61b59
add commands sketches to control reboot and version
alessio-perugini Jul 5, 2023
d71bfc4
handle new way to reboot the board
alessio-perugini Jul 5, 2023
284aefa
use bcmi-labs/hid fork
alessio-perugini Jul 5, 2023
f273dd3
remove tmp files
alessio-perugini Jul 5, 2023
e658015
update .gitignore
alessio-perugini Jul 6, 2023
e680741
use commands sketch to retrive board version
alessio-perugini Jul 6, 2023
023a3bc
refactor HID logic
alessio-perugini Jul 6, 2023
97b447d
add missing modem.begin()
alessio-perugini Jul 6, 2023
a43c70d
update helper deps that fixes the proper tools discovery path
alessio-perugini Jul 6, 2023
e54809c
use espflash write-bin command to flash the firmware
alessio-perugini Jul 7, 2023
f627281
add a small information message before the flash step
alessio-perugini Jul 7, 2023
bd325d5
add taskfile + dist templates
alessio-perugini Jul 7, 2023
9802758
fix CR
alessio-perugini Jul 7, 2023
8881cd6
better error handling
alessio-perugini Jul 7, 2023
d126843
fix changing serial port after going in esp mode
alessio-perugini Jul 7, 2023
acbb820
rename some serial pkg types
alessio-perugini Jul 7, 2023
cb7000a
add some commnets in reboot function
alessio-perugini Jul 7, 2023
56b8b6e
Add PemToCrt function
alessio-perugini Jul 11, 2023
7f8bb49
Use PemToCrt function in UploadCertificate
MatteoPologruto Jul 11, 2023
1453f32
add padding
alessio-perugini Jul 11, 2023
1c56359
remove LICENSE in favor of LICENSE.txt
alessio-perugini Jul 11, 2023
0023bef
update commands.ino to send multiple commands
alessio-perugini Jul 12, 2023
4efe023
reboot logic now read the fw version to decide which logic to apply
alessio-perugini Jul 12, 2023
d9b324a
add logging
alessio-perugini Jul 12, 2023
d718986
add slog license files
alessio-perugini Jul 12, 2023
37c4d48
add go.work.sum to .gitignore
alessio-perugini Jul 12, 2023
40a6925
fix a panic when the serial port is busy
alessio-perugini Jul 12, 2023
d3c213c
update the helper pkg (adds: fqbn and logging)
alessio-perugini Jul 12, 2023
e5a4945
add license headers to *.go files
alessio-perugini Jul 12, 2023
1c10533
comment public exported function of serial and serial/utils pkg
alessio-perugini Jul 12, 2023
edb19a7
Add CI workflow to check for unapproved Go dependency licenses (#4)
MatteoPologruto Jul 12, 2023
67dfa29
Add CI workflow to lint and check formatting of Go code (#3)
MatteoPologruto Jul 12, 2023
caee3cd
Add CI workflow to publish releases (#2)
umbynos Jul 12, 2023
05d7677
fix typos
alessio-perugini Jul 12, 2023
d50eac2
fix possible infinite loop when parsin invalid pem content
alessio-perugini Jul 13, 2023
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
157 changes: 157 additions & 0 deletions .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md
name: Check Go Dependencies

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.20"

# See: https://docs.github.com/actions/using-workflows/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@v3
with:
submodules: recursive

# This is required to allow jonabc/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: jonabc/setup-licensed@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Update dependencies license metadata cache
run: 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@v3
with:
if-no-files-found: error
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@v3
with:
submodules: recursive

# This is required to allow jonabc/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: jonabc/setup-licensed@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check for dependencies with unapproved licenses
run: task --silent general:check-dep-licenses
234 changes: 234 additions & 0 deletions .github/workflows/check-go-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-task.md
name: Check Go

env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.20"

# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-go-task.ya?ml"
- "Taskfile.ya?ml"
- "**/go.mod"
- "**/go.sum"
- "**.go"
pull_request:
paths:
- ".github/workflows/check-go-task.ya?ml"
- "Taskfile.ya?ml"
- "**/go.mod"
- "**/go.sum"
- "**.go"
schedule:
# Run periodically to catch breakage caused by external changes.
- cron: "0 7 * * 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-errors:
name: check-errors (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check for errors
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task go:vet

check-outdated:
name: check-outdated (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Modernize usages of outdated APIs
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task go:fix

- name: Check if any fixes were needed
run: git diff --color --exit-code

check-style:
name: check-style (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Install golint
run: go install golang.org/x/lint/golint@latest

- name: Check style
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task --silent go:lint

check-formatting:
name: check-formatting (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Format code
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: task go:format

- name: Check formatting
run: git diff --color --exit-code

check-config:
name: check-config (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest
permissions:
contents: read

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Run go mod tidy
working-directory: ${{ matrix.module.path }}
run: go mod tidy

- name: Check whether any tidying was needed
run: git diff --color --exit-code
Loading