190 Commits

Author SHA1 Message Date
dependabot[bot]
c6ca14182b
Bump actions/stale from 8.0.0 to 9.0.0 (#2980)
Bumps [actions/stale](https://github.com/actions/stale) from 8.0.0 to 9.0.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8.0.0...v9.0.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 15:23:33 +01:00
Stefan Agner
20295a5f0b
Fix RAUC certificate check (#2955)
Check the right environment variable when determining if RAUC
certificates through secrets are provided.
2023-11-30 17:49:16 +01:00
Stefan Agner
c3b9912e2e
Generate self-signed certificates for development (#2943)
* Generate self-signed certificates for development

To simplify development generate a self-signed certificate on first
build. Also make sure that the self-signed certificate is being added
the RAUC keyring so that manual updates can be performed.

* Add self-signed certificat independent of deployment type

* Add a warning when building with self-signed certificate
2023-11-27 18:36:12 +01:00
dependabot[bot]
741498c92b
Bump dessant/label-actions from 4.0.0 to 4.0.1 (#2946)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-27 14:38:45 +01:00
dependabot[bot]
9fd789cdb5
Bump docker/build-push-action from 5.0.0 to 5.1.0 (#2935)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-20 14:15:27 +01:00
dependabot[bot]
1848fd7555
Bump actions/github-script from 6 to 7 (#2934)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-20 14:14:51 +01:00
dependabot[bot]
754bec30fd
Bump dessant/label-actions from 3.1.0 to 4.0.0 (#2922)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 14:30:44 +01:00
Stefan Agner
fccb11cad1
Revert "Upload artifacts index even on partial builds (#2901)" (#2905)
This reverts commit 49f26c3d2e685e3f7e9135f8e10efaa6a40526df.

The steps is not valid in that context. Let's revert the commit to get a
green build first.
2023-11-02 16:35:26 +01:00
Stefan Agner
49f26c3d2e
Upload artifacts index even on partial builds (#2901)
Make sure that the artifacts index always gets updated. This allows to
use builds even when not all of them are available.
2023-11-02 13:46:12 +01:00
Jan Čermák
d9b49bbcb8
Add pruning of object file cache (#2899) 2023-11-02 13:45:56 +01:00
Stefan Agner
586f2ea021
Fix Artifacts index bump when using workflow_call (#2900)
Use inputs.version which is available for workflow_call as well as
workflow_dispatch.
2023-11-02 11:33:55 +01:00
Stefan Agner
204bd8bb56
Pass secrets to artifacts index generation workflow (#2893) 2023-10-31 23:22:10 +01:00
Stefan Agner
c33fc03fd6
Checkout source code when uploading artifacts index (#2892)
The index.html file comes from the repository source directory. Make sure
it is checked out when regenerating the artifacts index.
2023-10-31 14:37:02 +01:00
Jan Čermák
d7e3a8b985
Fix the condition for OS artifact download (#2891) 2023-10-31 14:08:49 +01:00
Stefan Agner
e4e4c62834
Fix quotes in artifact index generation (#2889) 2023-10-31 14:00:19 +01:00
Stefan Agner
2e8b66d283
Separate artifacts index update into separate workflow (#2888)
* Separate artifacts index update into separate workflow

* Apply suggestions from code review

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>

---------

Co-authored-by: Jan Čermák <sairon@users.noreply.github.com>
2023-10-31 13:50:35 +01:00
Jan Čermák
54cab43ea3
Add a flag to determine tests were called from another workflow (#2887)
If a reusable workflow is called from another workflow, the event_type
in the child workflow is still the same as parent's. This is a known
"feature": https://github.com/actions/runner/discussions/1884

Add a flag to inputs that has default value set to true. This is in turn
set only if the workflow is called from another one, chosing the correct
step for obtaining the OS image.
2023-10-31 10:12:37 +01:00
Jan Čermák
d39a767bfb
Bump HAOS beta when stable version is released (#2885)
Beta users should also get latest stable without the need for manual
bump.

Suggested here: https://github.com/home-assistant/operating-system/pull/2855#discussion_r1368678727
2023-10-31 10:12:29 +01:00
Jan Čermák
5e5462ddde
Always use environment for bump_version job (#2884)
As discussed here: https://github.com/home-assistant/operating-system/pull/2855#discussion_r1368533496
2023-10-31 10:12:21 +01:00
Jan Čermák
39778e882a
Add test suite for Supervisor tests (#2880)
* Add test suite for Supervisor tests

* test_supervisor_is_updated should depend on test_update_supervisor

Co-authored-by: Stefan Agner <stefan@agner.ch>

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-10-31 10:12:10 +01:00
Jan Čermák
ae711734bf
Run tests within build workflow (#2882) 2023-10-30 15:42:03 +01:00
Stefan Agner
6d7db27f84
Use the correct secret to clear cache on the Cloudflare frontend (#2881) 2023-10-30 14:54:22 +01:00
Stefan Agner
8133cfead8
Print object cache statistics before upload (#2874)
Print the object cache statistics before uploading them to the action
cache. The action cache accesses all files, this makes the statistics
of files used during build not useful.
2023-10-27 21:04:47 +02:00
Stefan Agner
91e82e40d9
Install AWS CLI tools in final build step (#2873) 2023-10-27 21:04:17 +02:00
Jan Čermák
6e8568c666
Optimize build cache for dev builds (#2872)
* Optimize build cache for dev builds

* Remove downloaded files cache, as it doesn't save that much time and
  it can't fit into the repo cache limit, randomly causing eviction of
  CC object cache for a single board.
* Limit saving of the object cache only to the dev branch, because
  of the restrictions for the cache access limit us from effectively
  using the cache for rc/main branches anyway.
* Adjust names of the steps a bit for clarity.

* Add printing of some cache stats

* Compare old ccache files' age to Makefile
2023-10-27 13:56:44 +02:00
Jan Čermák
4769d22b3c
Add checkout step to bump_version job in the build workflow (#2871)
It's required both for the artifact index and to run the RPi Imager bump
local action.
2023-10-27 09:33:05 +02:00
Stefan Agner
28c13d7709
Fix GitHub action build.yaml (#2868) 2023-10-26 21:09:12 +02:00
Stefan Agner
9e70ebe989
Maintain and upload artifacts index (#2839)
* Maintain and upload artifacts index

Make the artifacts browsable by maintaining a list of builds. This keeps
it up-to-date even when deleting images from the object storage, and
minimizes queries to the object storage.

* Add favicon

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Move index update outside of the build Matrix

* Add error handling and styling

* Exclude index files

* Add cache flush

* Use separate prefix for indexes

This allows to filter by prefix when generating the main index. Since
the list-objects-v2 is limited to 1000 entries, this will be a bottle
neck soon. Separating indexes allows to support up to 1000 nightly
builds.

* Add missing backslash

* Use cp and fix index format

* Sync index.html as well

* Move OS artifacts index file to root directory

This is not really GitHub related, so it shouldn't live in there.

* Adjust URL for dev builds

---------

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2023-10-26 20:24:04 +02:00
Jan Čermák
ae42fbf235
Add action for bumping OS version for RPi imager (#2861)
Automate bump of the rpi-imager-haos.json in the version repository on
stable release so we don't have to do it manually. Uses slightly
advanced jq magic to touch only the changed fields and keep the rest of
the JSON content intact.
2023-10-26 10:21:31 +02:00
Jan Čermák
b55e6c22c2
Do not use working-directory in test job (#2858) 2023-10-23 18:15:10 +02:00
Jan Čermák
e928fa498f
Use alternative environment for release build bump (#2855)
* Use alternative environment for release build bump

By using a separate environment, we can postpone the bump in the version
repository by adding a requirement for approval. Dev version will use
default (empty string) environment which doesn't have any constraints.

* Update build step name - it's not always dev build anymore

* Use dynamic environment name for beta/stable channels
2023-10-23 12:34:11 +02:00
Jan Čermák
caf6611f7d
Fix extraction of OVA image artifact in test step (#2842)
* Fix extraction of OVA image artifact in test step

If the test image is obtained from an artifact instead of downloading,
its name contains the version as well, in that case we still need to use
wildcard expansion.

* uncompress qcow2 to a stable filename
2023-10-19 22:58:00 +02:00
Jan Čermák
d7b32fd100
Fix path to test results in processing steps (#2837)
Working-directory is relevant only for run steps, the other steps need
full path relative to the repository root.
2023-10-18 11:31:23 +02:00
Jan Čermák
d4cb408090
Fix test action by checking out source first (#2836)
The first action can't be action with simple run step, because it is
respecting the working-directory already. Put checkout step to the top.
2023-10-17 23:43:50 +02:00
Jan Čermák
3e36628c09
Create foundation for Labgrid-based OS tests (#2812)
* Create foundation for Labgrid-based OS tests

Add foundation for Labgrid-based tests of OS builds. Currently uses just
the QEMU driver, which starts a virtual machine with pristine OS, and
generates few log reports which are saved as build artifacts.

Workflow is currently triggered either manually by specifying an OS
version, or by OS build job, which now saves an artifact of the OVA
image. This allows for some modularity. If we eventually add the
possibility to run builds on PRs, we could also add the workflow_call
trigger and turn the workflow into a reusable one.

TBD (in future PRs): some meaningful tests and possibility to test on
real hardware (either local or distributed).

* Apply suggestions from @agners

Co-authored-by: Stefan Agner <stefan@agner.ch>

* Wrap test command in a script, create venv for local tests

* Make shellcheck happy

---------

Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-10-17 18:23:29 +02:00
Stefan Agner
7845199fa8
Add Home Assistant Green to GitHub infrastructure (#2828)
Add Home Assistant Green to the issue template and release drafter
configuration.
2023-10-16 14:32:36 +02:00
Stefan Agner
19ded665bd
Drop uploading to the old development build server (#2802)
With the new development build uploads on R2 working, we no longer need
to upload development builds to the old server. Drop the build step.
2023-10-10 13:51:33 +02:00
Joakim Sørensen
a72c6c0322
Add action job to upload artifacts to R2 (#2779) 2023-10-02 08:29:00 +02:00
Stefan Agner
dd21a73031
Fix versioning set during build (#2771)
Respect quotes in the meta file. While at it, simplify version
validation as well.

Make sure development version is correctly set at build time.

While at it also simplify version check.
2023-09-25 18:32:57 +02:00
Stefan Agner
3df2749171
Adjust Home Assistant OS versioning to prepare for new release strategy (#2767)
* Adjust Home Assistant versioning to prepare for new release strategy

With OS 11 we'll create rc pre-releases which will get directly pushed
to the beta channel. In contrast, release builds will get directly
pushed to the stable channel.

Similar to Home Assistant Core we'll create bump commits for all stable
and beta releases. This makes sure that the source code matches the
built binaries for all releases.

The development build will get a generated version. To avoid issues
with the new rc builds the dev build version will get injected on source
level now.

* Apply suggestions from code review
2023-09-25 13:41:50 +02:00
Stefan Agner
8d6b4eb11b
Unify release and dev GitHub actions (#2764)
Use a single workflow file for releases and dev builds. This avoids
duplication and enhances the release builds with some of the recent
improvements (e.g. shared build container).
2023-09-21 17:06:41 +02:00
dependabot[bot]
8d8327801f
Bump docker/login-action from 2.2.0 to 3.0.0 (#2757)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2.2.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 10:02:18 +02:00
dependabot[bot]
b7e958d498
Bump docker/build-push-action from 4.2.1 to 5.0.0 (#2758)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.2.1 to 5.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.2.1...v5.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 09:56:34 +02:00
dependabot[bot]
3e173ca77e
Bump docker/setup-buildx-action from 2.10.0 to 3.0.0 (#2759)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.10.0 to 3.0.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2.10.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 09:55:24 +02:00
dependabot[bot]
3d7a17c59f
Bump docker/build-push-action from 4.1.1 to 4.2.1 (#2748)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 4.2.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.1.1...v4.2.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 22:35:32 +02:00
Stefan Agner
bf327c968a
Don't combine GitHub action caches (#2745)
It turns out that the way concurrency works in GitHub action doesn't
allow to queue up multiple pending jobs. As soon as a second job gets
pending, the previous pending jobs get cancelled. So this does not allow
to sequentially run all cache combine jobs as we hoped for.

Let's use a single download cache and per board build cache for now.
2023-09-08 08:16:21 +02:00
Stefan Agner
25545b609e
Combine downloads and compile cache in GitHub Action cache (#2743)
This combines all caches in a single cache to save space (assumption is
that quite some files are duplicated otherwise). With this we shouold
end up with 4 relevant cache files (build cache for each architecture
plus download cache).
2023-09-08 00:14:08 +02:00
Stefan Agner
52a455c6ca
Execute stale workflow only once a day (#2739) 2023-09-07 08:59:25 +02:00
Stefan Agner
41c3b6565d
Improve GitHub Action caching (#2732)
Use more specific keys for GitHub Action caches to make sure we update
caches regularly. Also add board id to the downloads cache to get a
more specific cache file. This avoid redownloading large dependencies
of some boards.
2023-09-05 21:44:11 +02:00
dependabot[bot]
516cb71df9
Bump actions/checkout from 3 to 4 (#2728)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 23:14:03 +02:00