Skip to content

Setup build CI workflow#1

Open
sebastienvermeille wants to merge 1 commit intomainfrom
feat/ci-setup-build-workflow
Open

Setup build CI workflow#1
sebastienvermeille wants to merge 1 commit intomainfrom
feat/ci-setup-build-workflow

Conversation

@sebastienvermeille
Copy link
Collaborator

@sebastienvermeille sebastienvermeille commented Dec 7, 2024

Target main branch (should be adapted for beta and devel)

Changes

  • Introduce Makefile - With this abstraction layer both: CI and developers, can make use of common commands to setup their environment (build and compile the project, flash some devices and so on independently of their OS)

  • Setup Pip and Pip lock files - That way platformio dependency in use is pinned in pip.lock (changes are operated as code and in a deterministic manner) + ease installation for developers and CI

  • Configure dependabot for python packages - That way we benefit from automatic PR for new versions including security, feat/bugfix

  • Fix pre-commit issues (shellcheck)

  • Remove .bin files (will be stored on cloudsmith)

  • Add build-pr.yml workflow responsible to: compile the firmware, run pre-commit checks (formatting enforcement) and store an artifact within github builds (1 day retention) - useful for local testing

  • Add a build-main.yml workflow responsible to release an edge release (experimental) each time a PR is merged into the main branch (that way we can test it before releasing) This release is hosted on cloudsmith too so we can really test it also via the nspm docker later on (when we have a feature to select the OTA release channel stable|experimental)

  • Add release.yml workflow responsible to publish release artifacts when the release is created on GitHub artifacts are stored in cloudsmith.

All cloudsmith artifacts have distinct labels in order to ease retrieval and setup distinct retention policies. (We might want to preserve only the last 10 edge releases but keep all the stable release by example)

At the moment only the following artifacts are stored on cloudsmith:

  • firmware.bin
  • littlefs.bin
  • firmware-aio.bin (the whole firmware required for the initial flash of the NSPanel including bootstrap firmware)

@sebastienvermeille sebastienvermeille self-assigned this Dec 7, 2024
@sebastienvermeille sebastienvermeille force-pushed the feat/ci-setup-build-workflow branch 2 times, most recently from 8e10ca7 to 4f96768 Compare January 17, 2025 14:42
@sebastienvermeille sebastienvermeille force-pushed the feat/ci-setup-build-workflow branch from cdf8cd1 to 2f8bbc4 Compare January 17, 2025 15:28
@sebastienvermeille sebastienvermeille added the CI/CD Continuous integration/deployment label Jan 17, 2025
@sebastienvermeille sebastienvermeille marked this pull request as ready for review January 17, 2025 15:35
# Optional: Print version to verify
echo "Version in environment variable: ${{ env.VERSION }}"

- name: Replace version in nspm-bin-version.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step doesn't actually replace the version in the nspm-bin-version.h file. So, this step should be renamed to something more appropriate.

# Optional: Print version to verify
echo "Version in environment variable: ${{ env.VERSION }}"

- name: Replace version in nspm-bin-version.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here, this step doesn't actually replace the version in the file.

fi
echo "Version matches release tag."

- name: Replace version in nspm-bin-version.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, perhaps not the best name. Perhaps "Update workflow firmware identifier" or something like that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is heavily used during development to upload a built firmware from the CLI to the local manager to be pushed to the test panel OTA. Perhaps it's possible to implement this in the makefile somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Continuous integration/deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants