Skip to content

Commit 38fb1c8

Browse files
committed
Update workflows
1 parent 07edb7e commit 38fb1c8

8 files changed

+61
-300
lines changed

.github/workflows/build.yml

+7-105
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,47 @@
1-
name: 'Build'
1+
name: 'Build artifact'
22

33
on:
44
push:
55
branches:
66
- dev
7-
- "release*"
7+
- main
88
tags:
99
- '*'
1010
pull_request:
1111

1212
env:
1313
TARGETS: f7
1414
DEFAULT_TARGET: f7
15-
FBT_TOOLCHAIN_PATH: /home/runner/work
1615

1716
jobs:
18-
main:
17+
build:
1918
runs-on: ubuntu-latest
2019
steps:
21-
- name: 'Decontaminate previous build leftovers'
22-
run: |
23-
if [ -d .git ]; then
24-
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
25-
fi
2620

2721
- name: 'Checkout code'
2822
uses: actions/checkout@v3
2923
with:
3024
fetch-depth: 0
3125
ref: ${{ github.event.pull_request.head.sha }}
3226

33-
- name: 'Get commit details'
34-
id: names
35-
run: |
36-
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
37-
TYPE="pull"
38-
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
39-
TYPE="tag"
40-
else
41-
TYPE="other"
42-
fi
43-
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
44-
echo random_hash=$(openssl rand -base64 40 | shasum -a 256 | awk '{print $1}') >> $GITHUB_OUTPUT
45-
echo "event_type=$TYPE" >> $GITHUB_OUTPUT
46-
47-
- name: 'Make artifacts directory'
48-
run: |
49-
rm -rf artifacts
50-
rm -rf map_analyser_files
51-
mkdir artifacts
52-
mkdir map_analyser_files
53-
54-
- name: 'Bundle scripts'
55-
run: |
56-
tar czpf artifacts/flipper-z-any-scripts-${SUFFIX}.tgz scripts debug
57-
5827
- name: 'Build the firmware'
5928
run: |
6029
set -e
6130
for TARGET in ${TARGETS}; do
6231
TARGET="$(echo "${TARGET}" | sed 's/f//')"; \
63-
./fbt TARGET_HW=$TARGET copro_dist updater_package \
64-
${{ startsWith(github.ref, 'refs/tags') && 'DEBUG=0 COMPACT=1' || '' }}
65-
done
66-
67-
- name: 'Move upload files'
68-
run: |
69-
set -e
70-
for TARGET in ${TARGETS}; do
71-
mv dist/${TARGET}-*/* artifacts/
32+
./fbt TARGET_HW=$TARGET updater_package
7233
done
7334
7435
- name: "Check for uncommitted changes"
7536
run: |
7637
git diff --exit-code
7738
78-
- name: 'Bundle resources'
79-
run: |
80-
tar czpf "artifacts/flipper-z-any-resources-${SUFFIX}.tgz" -C assets resources
81-
82-
- name: 'Bundle core2 firmware'
83-
run: |
84-
cp build/core2_firmware.tgz "artifacts/flipper-z-any-core2_firmware-${SUFFIX}.tgz"
85-
86-
- name: 'Copy map analyser files'
87-
run: |
88-
cp build/f7-firmware-*/firmware.elf.map map_analyser_files/firmware.elf.map
89-
cp build/f7-firmware-*/firmware.elf map_analyser_files/firmware.elf
90-
cp ${{ github.event_path }} map_analyser_files/event.json
91-
9239
- name: 'Updater artifact'
9340
uses: actions/upload-artifact@v3
9441
with:
9542
name: updater
9643
path: |
97-
artifacts/f7-*
98-
99-
- name: 'Firmware artifact'
100-
uses: actions/upload-artifact@v3
101-
with:
102-
name: firmware
103-
path: |
104-
artifacts
44+
dist/${{ env.DEFAULT_TARGET }}-*
10545
10646
# - name: 'Find Previous Comment'
10747
# if: ${{ github.event.pull_request }}
@@ -110,7 +50,7 @@ jobs:
11050
# with:
11151
# issue-number: ${{ github.event.pull_request.number }}
11252
# comment-author: 'github-actions[bot]'
113-
# body-includes: 'Compiled firmware for commit'
53+
# body-includes: 'Compiled firmware:'
11454

11555
# - name: Artifact info
11656
# id: artifact-info
@@ -125,44 +65,6 @@ jobs:
12565
# comment-id: ${{ steps.fc.outputs.comment-id }}
12666
# issue-number: ${{ github.event.pull_request.number }}
12767
# body: |
128-
# **Compiled firmware for commit `${{steps.names.outputs.commit_sha}}`:**
68+
# **Compiled firmware:**
12969
# - [📦 Update package](${{steps.artifact-info.outputs.artifacts[0].archive_download_url}})
13070
# edit-mode: replace
131-
132-
compact:
133-
if: ${{ !startsWith(github.ref, 'refs/tags') }}
134-
runs-on: ubuntu-latest
135-
steps:
136-
- name: 'Decontaminate previous build leftovers'
137-
run: |
138-
if [ -d .git ]
139-
then
140-
git submodule status \
141-
|| git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
142-
fi
143-
144-
- name: 'Checkout code'
145-
uses: actions/checkout@v3
146-
with:
147-
fetch-depth: 0
148-
submodules: true
149-
ref: ${{ github.event.pull_request.head.sha }}
150-
151-
- name: 'Get commit details'
152-
run: |
153-
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
154-
TYPE="pull"
155-
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
156-
TYPE="tag"
157-
else
158-
TYPE="other"
159-
fi
160-
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
161-
162-
- name: 'Build the firmware'
163-
run: |
164-
set -e
165-
for TARGET in ${TARGETS}; do
166-
TARGET="$(echo "${TARGET}" | sed 's/f//')"; \
167-
./fbt TARGET_HW=$TARGET DEBUG=0 COMPACT=1 fap_dist updater_package
168-
done

.github/workflows/check_submodules.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- dev
7-
- "release*"
7+
- main
88
tags:
99
- '*'
1010
pull_request:
@@ -13,11 +13,6 @@ jobs:
1313
check_protobuf:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: 'Decontaminate previous build leftovers'
17-
run: |
18-
if [ -d .git ]; then
19-
git submodule status || git checkout "$(git rev-list --max-parents=0 HEAD | tail -n 1)"
20-
fi
2116

2217
- name: 'Checkout code'
2318
uses: actions/checkout@v3

.github/workflows/lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Lint code formatting'
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
tags:
9+
- '*'
10+
pull_request:
11+
12+
env:
13+
SET_GH_OUTPUT: 1
14+
15+
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
20+
- name: 'Checkout code'
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
ref: ${{ github.event.pull_request.head.sha }}
25+
26+
- name: 'Check code formatting'
27+
run: ./fbt lint lint_py

.github/workflows/lint_c.yml

-47
This file was deleted.

.github/workflows/lint_python.yml

-33
This file was deleted.

.github/workflows/pvs_studio.yml

-93
This file was deleted.

0 commit comments

Comments
 (0)