Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Changed

- Migrate `zephyr` workflow to `self-hosted-systemd` runners. `zephyr` workflow now uses Docker
containers to manage tooling and dependencies.

### Deprecated

- Deprecate the old `zephyr` workflow and move it into `old-zephyr` workflow folder.

## [0.6.0] - 2023-12-20

### Added
Expand Down
30 changes: 30 additions & 0 deletions workflow-templates/old-zephyr/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report about something not working
title: BUG - <subject title related to the issue>
labels: "type: bug"
assignees: ""
---

#### Describe the bug

<!-- A clear and concise description of what the bug is. -->

#### Firmware/software version

<!-- Version where the bug appears. -->

#### Hardware version

<!-- Hardware version where the bug appears, if relevant. -->

#### Steps to reproduce

<!-- Steps to reproduce the behaviour: -->

<!-- 1. Go to '...' -->
<!-- 2. Click on '....' -->

#### Additional context

<!-- Add any other context about the problem here. -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature request
about: Development issue describing something new to be added to the project
title: "<subject title related to the issue>"
labels: "type: feature request"
assignees: ""
---

## Context

<!--- Provide some context why is this feature needed.
Does it build from an existing feature, does it enable an implementation of some
other new feature? -->

## Required steps / Implementation details

<!--- Either provide a list of steps that are required for this feature and/or
provide technical details on how this feature will be implemented. -->

## Definition of Done

<!--- Explicitly define conditions when this feature request is considered done,
so it can be reviewed and validated. -->

<!-- For example: Described feature is implemented, documented, tested and
reviewed. -->
4 changes: 4 additions & 0 deletions workflow-templates/old-zephyr/.github/pr-labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add labels (on the left) to the PRs of specific branches (on the right)
pull request: feature/*
release: release/*
fix: fix/*
36 changes: 36 additions & 0 deletions workflow-templates/old-zephyr/.github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Description

<!--- A summary of the changes that this PR introduces. Provide a relevant
motivation and context about this PR or link an issue that provides it. -->

Closes #

Related #

## Areas of interest for the reviewer

<!--- Which parts of the code should the code reviewer check? -->

## Checklist

<!--- Check items that you fulfilled, strikeout the ones that do not apply and
write why -->

- [ ] My code follows the [style guidelines] as defined by IRNAS.
- [ ] I have performed a self-review of my code.
- [ ] My changes generate no new warnings.
- [ ] I added/updated source code documentation for all newly added or changed functions.
- [ ] I updated all customer-facing technical documentation.

Example strikeout: - [x] ~~I updated all customer-facing technical documentation.~~ - This PR
introduced only internal facing changes.

## After-review steps

<!--- Delete section or select one option -->

- Reviewer can merge and delete the branch.
- I will merge PR by myself.

[style guidelines]:
https://github.com/IRNAS/irnas-guidelines-docs/blob/main/docs/developer_guidelines.md
136 changes: 136 additions & 0 deletions workflow-templates/old-zephyr/.github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Build

on:
workflow_call:
inputs:
checkout_ref:
required: true
type: string
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- "main"
workflow_dispatch:

env:
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}

jobs:
build:
runs-on: self-hosted
defaults:
run:
shell: bash
# Set work dir to "project" for all 'run' calls. Beware, everything else
# (actions, 'with' params, etc.) still needs to reference full path.
working-directory: project

steps:
- name: Checkout last PR commit
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: project

- name: Checkout last tag
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout_ref }}
path: project

- name: Checkout main
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
ref: main
path: project

# This is needed due to the later east update (west update) command that
# could be cloning from the private repos. The provided token in
# GIT_CREDENTIALS needs to be a fine-grained token, with access to all
# repositores, with "Read-only" access level to the Content repository
# permissions.
- name: Set Git credentials
run: |
git config --global credential.helper '!f() { printf "%s\n" "username=runner" "password=$GIT_CREDENTIALS"; };f'

- name: Install and cache apt packages
if: contains(runner.name, 'Github Action')
uses: awalsh128/cache-apt-pkgs-action@v1.4.1
with:
packages: gcc-multilib
# Update this manually when changing the packages above, increment
# only minor version to keep APT caches separate.
version: 1.0

- name: Retrieve cache
if: contains(runner.name, 'Github Action')
uses: actions/cache@v4
env:
cache-name: cache-modules
with:
path: |
bootloader
modules
nrf
nrfxlib
test
tools
zephyr
~/.local/share/east/downloads/
~/.local/share/east/tooling/nrfutil
# Note above two lines, if we are caching entire ~/.local/share/east
# folder then cache action fails during download/extract step
key:
${{ runner.os }}-build-${{ env.cache-name }}-${{
hashFiles('project/west.yml') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: project/scripts/requirements.txt

- name: Install Python dependencies
run: pip install -r scripts/requirements.txt

- name: Install project dependencies
run: make install-dep

- name: Setup project
run: make project-setup

- name: Pre-build
run: make pre-build

- name: Quick build
if: github.event_name == 'push'
run: make quick-build

- name: Release
if:
github.event_name == 'workflow_dispatch' || github.event_name ==
'pull_request'
run: make release

- name: Pre-package
if: github.event_name == 'workflow_dispatch'
run: make pre-package

- name: Package artefacts
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v3
with:
name: artefacts
path: project/artefacts/*

- name: Post-build clean
# Only for self hosted runners
# Makes sure east init does not fail in the project setup
if: ${{ always() && !contains(runner.name, 'Github Action') }}
run: rm -rf ${{ github.workspace }}/.west
Loading