Skip to content

Commit 1efe91a

Browse files
committed
Sync with microG unofficial installer
1 parent c7d1fce commit 1efe91a

File tree

2 files changed

+55
-30
lines changed

2 files changed

+55
-30
lines changed

.github/workflows/auto-nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
keep-alive:
199199
name: "Keep alive"
200200
runs-on: ubuntu-latest
201-
timeout-minutes: 20
201+
timeout-minutes: 10
202202
if: "${{ github.event_name == 'schedule' }}"
203203
permissions:
204204
actions: write # Needed to keep alive the workflow
@@ -212,15 +212,15 @@ jobs:
212212
sparse-checkout-cone-mode: false
213213
- name: "Ping cache" # Cache expiration: 7 days
214214
uses: actions/cache@v4
215-
timeout-minutes: 10
215+
timeout-minutes: 5
216216
with:
217217
key: "build-${{ hashFiles('conf-2.sh') }}"
218218
path: "cache/build"
219219
enableCrossOsArchive: true
220220
lookup-only: true
221221
- name: "Keep workflow alive"
222222
uses: actions/github-script@v7
223-
timeout-minutes: 10
223+
timeout-minutes: 5
224224
env:
225225
WORKFLOW_REF: "${{ github.workflow_ref }}"
226226
with:
@@ -234,7 +234,7 @@ jobs:
234234
workflow_id: workflow_filename
235235
}).catch(response => response);
236236
if(response && response.status === 204) {
237-
// OK
237+
console.log('Succeeded.');
238238
} else {
239239
let errorMsg = 'enableWorkflow failed';
240240
if(response && response.status && response.message) errorMsg += ' with error ' + response.status + ' (' + response.message + ')';

.github/workflows/code-scan.yml

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,57 @@ on:
1313
- cron: "0 5 */365 1 *"
1414

1515
jobs:
16+
pre-requisites:
17+
name: "Pre-requisites"
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 10
20+
if: "${{ github.event_name == 'push' }}"
21+
outputs:
22+
dependency-graph-enabled: "${{ steps.dependency-graph.outputs.result }}"
23+
codacy-token-set: "${{ steps.check-tokens.outputs.CODACY_TOKEN_SET }}"
24+
sonar-token-set: "${{ steps.check-tokens.outputs.SONAR_TOKEN_SET }}"
25+
26+
steps:
27+
- name: "Verify tokens"
28+
id: check-tokens
29+
run: |
30+
# Verifying tokens...
31+
# Codacy
32+
if test -n '${{ secrets.CODACY_PROJECT_TOKEN }}'; then token_set='true'; else token_set='false'; fi
33+
printf 'CODACY_TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
34+
# SonarQube
35+
if test -n '${{ secrets.SONAR_TOKEN }}'; then token_set='true'; else token_set='false'; fi
36+
printf 'SONAR_TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
37+
- name: "Verify the dependency graph"
38+
id: dependency-graph
39+
uses: actions/github-script@v7
40+
timeout-minutes: 5
41+
with:
42+
retries: 3
43+
script: |
44+
/* jshint esversion: 6 */
45+
const response = await github.rest.dependencyGraph.exportSbom({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
}).catch(response => response);
49+
if(response && response.status === 200) {
50+
console.log('The dependency graph is enabled.');
51+
return true;
52+
} else if(response && response.status === 404) {
53+
console.error('::error::The dependency graph is disabled.');
54+
} else {
55+
let errorMsg = 'exportSbom failed';
56+
if(response && response.status && response.message) errorMsg += ' with error ' + response.status + ' (' + response.message + ')';
57+
throw new Error(errorMsg);
58+
}
59+
return false;
60+
1661
dependency-submission:
1762
name: "Dependency submission"
63+
needs: [pre-requisites]
1864
runs-on: ubuntu-latest
1965
timeout-minutes: 10
20-
if: "${{ github.event_name == 'push' }}"
66+
if: "${{ github.event_name == 'push' && needs.pre-requisites.outputs.dependency-graph-enabled == 'true' }}"
2167
permissions:
2268
contents: write
2369

@@ -36,33 +82,12 @@ jobs:
3682
dependency-graph: "generate-and-submit"
3783
validate-wrappers: true
3884

39-
verify-tokens:
40-
name: "Verify tokens"
41-
runs-on: ubuntu-latest
42-
timeout-minutes: 10
43-
if: "${{ github.event_name == 'push' }}"
44-
outputs:
45-
codacy-token-set: "${{ steps.check-tokens.outputs.CODACY_TOKEN_SET }}"
46-
sonar-token-set: "${{ steps.check-tokens.outputs.SONAR_TOKEN_SET }}"
47-
48-
steps:
49-
- name: "Verify tokens"
50-
id: check-tokens
51-
run: |
52-
# Verifying tokens...
53-
# Codacy
54-
if test -n '${{ secrets.CODACY_PROJECT_TOKEN }}'; then token_set='true'; else token_set='false'; fi
55-
printf 'CODACY_TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
56-
# SonarQube
57-
if test -n '${{ secrets.SONAR_TOKEN }}'; then token_set='true'; else token_set='false'; fi
58-
printf 'SONAR_TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
59-
6085
codacy:
6186
name: "Codacy"
62-
needs: [verify-tokens]
87+
needs: [pre-requisites]
6388
runs-on: ubuntu-latest
6489
timeout-minutes: 20
65-
if: "${{ github.event_name == 'push' && needs.verify-tokens.outputs.codacy-token-set == 'true' }}"
90+
if: "${{ github.event_name == 'push' && needs.pre-requisites.outputs.codacy-token-set == 'true' }}"
6691
concurrency:
6792
group: "${{ github.repository_id }}-${{ github.workflow }}-codacy"
6893
cancel-in-progress: false
@@ -98,10 +123,10 @@ jobs:
98123

99124
sonarqube:
100125
name: "SonarQube"
101-
needs: [verify-tokens]
126+
needs: [pre-requisites]
102127
runs-on: ubuntu-latest
103128
timeout-minutes: 20
104-
if: "${{ github.event_name == 'push' && needs.verify-tokens.outputs.sonar-token-set == 'true' }}"
129+
if: "${{ github.event_name == 'push' && needs.pre-requisites.outputs.sonar-token-set == 'true' }}"
105130

106131
steps:
107132
- name: "Checkout sources"

0 commit comments

Comments
 (0)