Skip to content

Commit c8a9e28

Browse files
committed
feat: deprecate old-zephyr workflow, update to zephyr with docker
Zephyr workflows now use Docker containers to manager tooling and environment. The previous Zephyr workflow was deprecated and moved into `old-zephyr` folder.
1 parent f0e1bcc commit c8a9e28

File tree

19 files changed

+1196
-178
lines changed

19 files changed

+1196
-178
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Migrate `zephyr` workflow to to `self-hosted-systemd` runners. `zephyr` workflow now uses Docker
12+
containers to manage tooling and dependencies.
13+
14+
### Deprecated
15+
16+
- Deprecate the old `zephyr` workflow and move it into `old-zephyr` workflow folder.
17+
918
## [0.6.0] - 2023-12-20
1019

1120
### Added
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: Create a report about something not working
4+
title: BUG - <subject title related to the issue>
5+
labels: "type: bug"
6+
assignees: ""
7+
---
8+
9+
#### Describe the bug
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
#### Firmware/software version
14+
15+
<!-- Version where the bug appears. -->
16+
17+
#### Hardware version
18+
19+
<!-- Hardware version where the bug appears, if relevant. -->
20+
21+
#### Steps to reproduce
22+
23+
<!-- Steps to reproduce the behaviour: -->
24+
25+
<!-- 1. Go to '...' -->
26+
<!-- 2. Click on '....' -->
27+
28+
#### Additional context
29+
30+
<!-- Add any other context about the problem here. -->
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Feature request
3+
about: Development issue describing something new to be added to the project
4+
title: "<subject title related to the issue>"
5+
labels: "type: feature request"
6+
assignees: ""
7+
---
8+
9+
## Context
10+
11+
<!--- Provide some context why is this feature needed.
12+
Does it build from an existing feature, does it enable an implementation of some
13+
other new feature? -->
14+
15+
## Required steps / Implementation details
16+
17+
<!--- Either provide a list of steps that are required for this feature and/or
18+
provide technical details on how this feature will be implemented. -->
19+
20+
## Definition of Done
21+
22+
<!--- Explicitly define conditions when this feature request is considered done,
23+
so it can be reviewed and validated. -->
24+
25+
<!-- For example: Described feature is implemented, documented, tested and
26+
reviewed. -->
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add labels (on the left) to the PRs of specific branches (on the right)
2+
pull request: feature/*
3+
release: release/*
4+
fix: fix/*
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Description
2+
3+
<!--- A summary of the changes that this PR introduces. Provide a relevant
4+
motivation and context about this PR or link an issue that provides it. -->
5+
6+
Closes #
7+
8+
Related #
9+
10+
## Areas of interest for the reviewer
11+
12+
<!--- Which parts of the code should the code reviewer check? -->
13+
14+
## Checklist
15+
16+
<!--- Check items that you fulfilled, strikeout the ones that do not apply and
17+
write why -->
18+
19+
- [ ] My code follows the [style guidelines] as defined by IRNAS.
20+
- [ ] I have performed a self-review of my code.
21+
- [ ] My changes generate no new warnings.
22+
- [ ] I added/updated source code documentation for all newly added or changed functions.
23+
- [ ] I updated all customer-facing technical documentation.
24+
25+
Example strikeout: - [x] ~~I updated all customer-facing technical documentation.~~ - This PR
26+
introduced only internal facing changes.
27+
28+
## After-review steps
29+
30+
<!--- Delete section or select one option -->
31+
32+
- Reviewer can merge and delete the branch.
33+
- I will merge PR by myself.
34+
35+
[style guidelines]:
36+
https://github.com/IRNAS/irnas-guidelines-docs/blob/main/docs/developer_guidelines.md
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Build
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
checkout_ref:
7+
required: true
8+
type: string
9+
pull_request:
10+
types: [opened, reopened, synchronize]
11+
push:
12+
branches:
13+
- "main"
14+
workflow_dispatch:
15+
16+
env:
17+
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}
18+
19+
jobs:
20+
build:
21+
runs-on: self-hosted
22+
defaults:
23+
run:
24+
shell: bash
25+
# Set work dir to "project" for all 'run' calls. Beware, everything else
26+
# (actions, 'with' params, etc.) still needs to reference full path.
27+
working-directory: project
28+
29+
steps:
30+
- name: Checkout last PR commit
31+
if: github.event_name == 'pull_request'
32+
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.event.pull_request.head.sha }}
35+
path: project
36+
37+
- name: Checkout last tag
38+
if: github.event_name == 'workflow_dispatch'
39+
uses: actions/checkout@v4
40+
with:
41+
ref: ${{ inputs.checkout_ref }}
42+
path: project
43+
44+
- name: Checkout main
45+
if: github.event_name == 'push'
46+
uses: actions/checkout@v4
47+
with:
48+
ref: main
49+
path: project
50+
51+
# This is needed due to the later east update (west update) command that
52+
# could be cloning from the private repos. The provided token in
53+
# GIT_CREDENTIALS needs to be a fine-grained token, with access to all
54+
# repositores, with "Read-only" access level to the Content repository
55+
# permissions.
56+
- name: Set Git credentials
57+
run: |
58+
git config --global credential.helper '!f() { printf "%s\n" "username=runner" "password=$GIT_CREDENTIALS"; };f'
59+
60+
- name: Install and cache apt packages
61+
if: contains(runner.name, 'Github Action')
62+
uses: awalsh128/cache-apt-pkgs-action@v1.4.1
63+
with:
64+
packages: gcc-multilib
65+
# Update this manually when changing the packages above, increment
66+
# only minor version to keep APT caches separate.
67+
version: 1.0
68+
69+
- name: Retrieve cache
70+
if: contains(runner.name, 'Github Action')
71+
uses: actions/cache@v4
72+
env:
73+
cache-name: cache-modules
74+
with:
75+
path: |
76+
bootloader
77+
modules
78+
nrf
79+
nrfxlib
80+
test
81+
tools
82+
zephyr
83+
~/.local/share/east/downloads/
84+
~/.local/share/east/tooling/nrfutil
85+
# Note above two lines, if we are caching entire ~/.local/share/east
86+
# folder then cache action fails during download/extract step
87+
key:
88+
${{ runner.os }}-build-${{ env.cache-name }}-${{
89+
hashFiles('project/west.yml') }}
90+
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
91+
92+
- name: Set up Python
93+
uses: actions/setup-python@v5
94+
with:
95+
python-version: "3.10"
96+
cache: "pip"
97+
cache-dependency-path: project/scripts/requirements.txt
98+
99+
- name: Install Python dependencies
100+
run: pip install -r scripts/requirements.txt
101+
102+
- name: Install project dependencies
103+
run: make install-dep
104+
105+
- name: Setup project
106+
run: make project-setup
107+
108+
- name: Pre-build
109+
run: make pre-build
110+
111+
- name: Quick build
112+
if: github.event_name == 'push'
113+
run: make quick-build
114+
115+
- name: Release
116+
if:
117+
github.event_name == 'workflow_dispatch' || github.event_name ==
118+
'pull_request'
119+
run: make release
120+
121+
- name: Pre-package
122+
if: github.event_name == 'workflow_dispatch'
123+
run: make pre-package
124+
125+
- name: Package artefacts
126+
if: github.event_name == 'workflow_dispatch'
127+
uses: actions/upload-artifact@v3
128+
with:
129+
name: artefacts
130+
path: project/artefacts/*
131+
132+
- name: Post-build clean
133+
# Only for self hosted runners
134+
# Makes sure east init does not fail in the project setup
135+
if: ${{ always() && !contains(runner.name, 'Github Action') }}
136+
run: rm -rf ${{ github.workspace }}/.west

0 commit comments

Comments
 (0)