Skip to content

Commit 1cc7ea2

Browse files
authored
Merge pull request #44 from DarkFlippers/fix/ci-cd
fix: matrix building
2 parents e14891f + 935ba9b commit 1cc7ea2

File tree

2 files changed

+150
-149
lines changed

2 files changed

+150
-149
lines changed

.github/workflows/build-with-firmwware.yml

+15-14
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
required: false
1010
type: string
1111
release:
12-
types: [ created,prereleased ]
12+
types: [created, prereleased]
1313
push:
1414
paths:
1515
- .github/workflows/build-with-firmware.yml
@@ -18,26 +18,27 @@ permissions:
1818
contents: write
1919
packages: write
2020

21+
concurrency:
22+
group: firmware-build-${{ vars.FIRMWARE_VERSION }}-${{ vars.RELEASE_VERSION }}
23+
cancel-in-progress: false
24+
2125
jobs:
2226
build-and-upload:
2327
runs-on: ubuntu-latest
24-
concurrency:
25-
group: firmware-build-${{ vars.FIRMWARE_VERSION }}-${{ vars.RELEASE_VERSION }}
26-
cancel-in-progress: false
2728
env:
2829
REPO_SELF: ${{ vars.REPO_SELF }}
2930
OFW_PATH: "applications_user/subbrute"
3031
RELATIVE_PATH: "applications/external/subbrute"
3132
CURRENT_VERSION: ${{ vars.RELEASE_VERSION }}
3233
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
33-
ZIP_NAME: ''
34-
ZIP_TAG: ''
35-
TGZ_NAME: ''
36-
TGZ_TAG: ''
34+
ZIP_NAME: ""
35+
ZIP_TAG: ""
36+
TGZ_NAME: ""
37+
TGZ_TAG: ""
3738
strategy:
3839
fail-fast: false
3940
matrix:
40-
firmware: [ unlshd ]
41+
firmware: [unlshd, official]
4142
include:
4243
- firmware: unlshd
4344
url: ${{ vars.REPO_UNLEASHED }}
@@ -143,11 +144,11 @@ jobs:
143144
run: |
144145
Remove-Item -Force -Recurse ./applications/debug -ErrorAction SilentlyContinue
145146
Remove-Item -Force -Recurse ./applications/examples -ErrorAction SilentlyContinue
146-
# New-Item -Force ./tmp -ItemType Directory -ErrorAction SilentlyContinue
147-
# Copy-Item -Force -Recurse ./applications/external/subbrute/ ./tmp/ -ErrorAction SilentlyContinue
148-
# Remove-Item -Force -Recurse ./applications/external/* -ErrorAction SilentlyContinue
149-
# Copy-Item -Force -Recurse /tmp/* ./applications/external/ -ErrorAction SilentlyContinue
150-
# Remove-Item -Force -Recurse ./tmp -ErrorAction SilentlyContinue
147+
# New-Item -Force ./tmp -ItemType Directory -ErrorAction SilentlyContinue
148+
# Copy-Item -Force -Recurse ./applications/external/subbrute/ ./tmp/ -ErrorAction SilentlyContinue
149+
# Remove-Item -Force -Recurse ./applications/external/* -ErrorAction SilentlyContinue
150+
# Copy-Item -Force -Recurse /tmp/* ./applications/external/ -ErrorAction SilentlyContinue
151+
# Remove-Item -Force -Recurse ./tmp -ErrorAction SilentlyContinue
151152

152153
- name: Build Firmware
153154
shell: bash

.github/workflows/codeql.yml

+135-135
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "master", "feat/ci" ]
16+
branches: ["master", "feat/ci"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "master" ]
19+
branches: ["master"]
2020
schedule:
21-
- cron: '43 14 * * *'
21+
- cron: "43 14 * * *"
2222
workflow_dispatch:
2323

2424
jobs:
@@ -29,7 +29,7 @@ jobs:
2929
# - https://gh.io/supported-runners-and-hardware-resources
3030
# - https://gh.io/using-larger-runners
3131
# Consider using larger runners for possible analysis time improvements.
32-
runs-on: 'ubuntu-latest'
32+
runs-on: "ubuntu-latest"
3333
timeout-minutes: 360
3434
permissions:
3535
actions: read
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
language: [ 'cpp' ]
42+
language: ["cpp"]
4343
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
4444
# Use only 'java' to analyze code written in Java, Kotlin or both
4545
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
@@ -52,137 +52,137 @@ jobs:
5252
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
5353
TOKEN: ${{ secrets.DEPENDABOT }}
5454
REF_NAME: ${{ github.ref_name }}
55-
55+
5656
steps:
57-
- name: Checkout Firmware Files
58-
uses: actions/checkout@v3
59-
with:
60-
repository: "${{ vars.REPO_UNLEASHED }}"
61-
clean: "true"
62-
submodules: "true"
63-
ref: "dev"
64-
fetch-depth: '0'
65-
66-
- name: Checkout Repo Files
67-
uses: actions/checkout@v3
68-
with:
69-
repository: "${{ vars.REPO_SELF }}"
70-
clean: "true"
71-
submodules: "true"
72-
path: "${{ env.OFW_PATH }}"
73-
fetch-depth: '0'
74-
75-
- name: Remove other apps
76-
shell: pwsh
77-
if: ${{ success() }}
78-
# rm to remove problem FAP which includes non-existent files
79-
run: |
80-
Remove-Item -Force -Recurse ./applications/debug -ErrorAction SilentlyContinue
81-
Remove-Item -Force -Recurse ./applications/examples -ErrorAction SilentlyContinue
82-
83-
- name: Set refname
84-
env:
85-
REF_NAME: ${{ env.REF_NAME }}
86-
shell: pwsh
87-
run: |
88-
$ReleaseVersion = ([string]::IsNullOrWhitespace($env:REF_NAME) ? 'dev' : $env:REF_NAME)
89-
Write-Output ('REF_NAME={0}' -f $ReleaseVersion) >> $env:GITHUB_ENV
90-
91-
# Initializes the CodeQL tools for scanning.
92-
- name: Initialize CodeQL
93-
uses: github/codeql-action/init@v2
94-
with:
95-
languages: ${{ matrix.language }}
96-
setup-python-dependencies: true
97-
#debug: true
98-
# If you wish to specify custom queries, you can do so here or in a config file.
99-
# By default, queries listed here will override any specified in a config file.
100-
# Prefix the list here with "+" to use these queries and those in the config file.
101-
102-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
103-
# queries: security-extended,security-and-quality
104-
105-
- name: Restore cached FW
106-
id: cache-fw-restore
107-
uses: actions/cache/restore@v3
108-
with:
109-
path: |
110-
./build
111-
./dist
112-
./firmware
113-
key: ${{ runner.os }}-fw
114-
115-
- name: Build Firmware
116-
shell: bash
117-
if: ${{ success() }}
118-
env:
119-
FBT_NO_SYNC: 0
120-
DIST_SUFFIX: 'codeql'
121-
WORKFLOW_BRANCH_OR_TAG: release-cfw
122-
run: |
57+
- name: Checkout Firmware Files
58+
uses: actions/checkout@v3
59+
with:
60+
repository: "${{ vars.REPO_UNLEASHED }}"
61+
clean: "true"
62+
submodules: "true"
63+
ref: "dev"
64+
fetch-depth: "0"
65+
66+
- name: Checkout Repo Files
67+
uses: actions/checkout@v3
68+
with:
69+
repository: "${{ vars.REPO_SELF }}"
70+
clean: "true"
71+
submodules: "true"
72+
path: "${{ env.OFW_PATH }}"
73+
fetch-depth: "0"
74+
75+
- name: Remove other apps
76+
shell: pwsh
77+
if: ${{ success() }}
78+
# rm to remove problem FAP which includes non-existent files
79+
run: |
80+
Remove-Item -Force -Recurse ./applications/debug -ErrorAction SilentlyContinue
81+
Remove-Item -Force -Recurse ./applications/examples -ErrorAction SilentlyContinue
82+
83+
- name: Set refname
84+
env:
85+
REF_NAME: ${{ env.REF_NAME }}
86+
shell: pwsh
87+
run: |
88+
$ReleaseVersion = ([string]::IsNullOrWhitespace($env:REF_NAME) ? 'dev' : $env:REF_NAME)
89+
Write-Output ('REF_NAME={0}' -f $ReleaseVersion) >> $env:GITHUB_ENV
90+
91+
# Initializes the CodeQL tools for scanning.
92+
- name: Initialize CodeQL
93+
uses: github/codeql-action/init@v2
94+
with:
95+
languages: ${{ matrix.language }}
96+
setup-python-dependencies: true
97+
#debug: true
98+
# If you wish to specify custom queries, you can do so here or in a config file.
99+
# By default, queries listed here will override any specified in a config file.
100+
# Prefix the list here with "+" to use these queries and those in the config file.
101+
102+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
103+
# queries: security-extended,security-and-quality
104+
105+
# - name: Restore cached FW
106+
# id: cache-fw-restore
107+
# uses: actions/cache/restore@v3
108+
# with:
109+
# path: |
110+
# ./build
111+
# ./dist
112+
# ./firmware
113+
# key: ${{ runner.os }}-fw
114+
115+
- name: Build Firmware
116+
shell: bash
117+
if: ${{ success() }}
118+
env:
119+
FBT_NO_SYNC: 0
120+
DIST_SUFFIX: "codeql"
121+
WORKFLOW_BRANCH_OR_TAG: release-cfw
122+
run: |
123123
./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=${{ env.FBT_NO_SYNC }}
124-
125-
- name: Build FAPs
126-
shell: bash
127-
if: ${{ success() }}
128-
env:
129-
FBT_NO_SYNC: 0
130-
DIST_SUFFIX: 'codeql'
131-
WORKFLOW_BRANCH_OR_TAG: release-cfw
132-
# rm to remove problem FAP which includes non-existent files
133-
run: |
124+
125+
- name: Build FAPs
126+
shell: bash
127+
if: ${{ success() }}
128+
env:
129+
FBT_NO_SYNC: 0
130+
DIST_SUFFIX: "codeql"
131+
WORKFLOW_BRANCH_OR_TAG: release-cfw
132+
# rm to remove problem FAP which includes non-existent files
133+
run: |
134134
./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=${{ env.FBT_NO_SYNC }} fap_dist
135135
136-
137-
- name: Save cached FW
138-
id: cache-primes-save
139-
uses: actions/cache/save@v3
140-
with:
141-
path: |
142-
./build
143-
./dist
144-
./firmware
145-
key: ${{ steps.cache-fw-restore.outputs.cache-primary-key }}
146-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
147-
# If this step fails, then you should remove it and run the build manually (see below)
148-
#- name: Autobuild
149-
# run: |
150-
# echo "Run, Build Application using script"
151-
# ls -lha
152-
# ./fbt
153-
# uses: github/codeql-action/autobuild@v2
154-
- name: Resolve CodeQL Build Env
155-
uses: github/codeql-action/resolve-environment@v2
156-
with:
157-
language: ${{ matrix.language }}
158-
159-
- name: Perform CodeQL Analysis
160-
uses: github/codeql-action/analyze@v2
161-
env:
162-
REF_NAME: ${{ env.REF_NAME }}
163-
CHECKOUT_PATH: ${{ env.OFW_PATH }}
164-
with:
165-
category: "/language:${{matrix.language}}"
166-
token: ${{ secrets.DEPENDABOT }}
167-
# Must be used only with sha
168-
#ref: ${{ env.REF_NAME }}
169-
#sha: ${{ github.sha }}
170-
output: "a${{ env.CHECKOUT_PATH }}/.github/results.sarif"
171-
check_name: "_"
172-
upload-database: false
173-
upload: 'failure-only'
174-
checkout_path: "${{ github.workspace }}/${{ env.CHECKOUT_PATH }}"
175-
176-
- name: Upload CodeQL SARIF
177-
uses: github/codeql-action/upload-sarif@v2
178-
env:
179-
REF_NAME: ${{ env.REF_NAME }}
180-
CHECKOUT_PATH: ${{ env.OFW_PATH }}
181-
with:
182-
category: "/language:${{matrix.language}}"
183-
#token: ${{ secrets.DEPENDABOT }}
184-
# Must be used only with sha
185-
#ref: ${{ env.REF_NAME }}
186-
#sha: ${{ github.sha }}
187-
sarif_file: "a${{ env.CHECKOUT_PATH }}/.github/results.sarif"
188-
checkout_path: "${{ github.workspace }}/${{ env.CHECKOUT_PATH }}"
136+
# - name: Save cached FW
137+
# id: cache-primes-save
138+
# uses: actions/cache/save@v3
139+
# with:
140+
# path: |
141+
# ./build
142+
# ./dist
143+
# ./firmware
144+
# key: ${{ steps.cache-fw-restore.outputs.cache-primary-key }}
145+
146+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
147+
# If this step fails, then you should remove it and run the build manually (see below)
148+
#- name: Autobuild
149+
# run: |
150+
# echo "Run, Build Application using script"
151+
# ls -lha
152+
# ./fbt
153+
# uses: github/codeql-action/autobuild@v2
154+
- name: Resolve CodeQL Build Env
155+
uses: github/codeql-action/resolve-environment@v2
156+
with:
157+
language: ${{ matrix.language }}
158+
159+
- name: Perform CodeQL Analysis
160+
uses: github/codeql-action/analyze@v2
161+
env:
162+
REF_NAME: ${{ env.REF_NAME }}
163+
CHECKOUT_PATH: ${{ env.OFW_PATH }}
164+
with:
165+
category: "/language:${{matrix.language}}"
166+
token: ${{ secrets.DEPENDABOT }}
167+
# Must be used only with sha
168+
#ref: ${{ env.REF_NAME }}
169+
#sha: ${{ github.sha }}
170+
output: "a${{ env.CHECKOUT_PATH }}/.github/results.sarif"
171+
check_name: "_"
172+
upload-database: false
173+
upload: "failure-only"
174+
checkout_path: "${{ github.workspace }}/${{ env.CHECKOUT_PATH }}"
175+
176+
- name: Upload CodeQL SARIF
177+
uses: github/codeql-action/upload-sarif@v2
178+
env:
179+
REF_NAME: ${{ env.REF_NAME }}
180+
CHECKOUT_PATH: ${{ env.OFW_PATH }}
181+
with:
182+
category: "/language:${{matrix.language}}"
183+
#token: ${{ secrets.DEPENDABOT }}
184+
# Must be used only with sha
185+
#ref: ${{ env.REF_NAME }}
186+
#sha: ${{ github.sha }}
187+
sarif_file: "a${{ env.CHECKOUT_PATH }}/.github/results.sarif"
188+
checkout_path: "${{ github.workspace }}/${{ env.CHECKOUT_PATH }}"

0 commit comments

Comments
 (0)