Rollback new amap workflow (#2152)

This commit is contained in:
Max Andreev 2022-12-19 20:09:19 +03:00 committed by GitHub
parent ef7052fbad
commit 361ca8b750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 37 deletions

View File

@ -1,8 +1,13 @@
name: 'Analyze .map file with Amap' name: 'Analyze .map file with Amap'
on: on:
repository_dispatch: push:
types: [make_map_analyse] branches:
- dev
- "release*"
tags:
- '*'
pull_request:
env: env:
TARGETS: f7 TARGETS: f7
@ -10,9 +15,24 @@ env:
jobs: jobs:
amap_analyse: amap_analyse:
if: ${{ !github.event.pull_request.head.repo.fork }}
runs-on: [self-hosted,FlipperZeroMacShell] runs-on: [self-hosted,FlipperZeroMacShell]
timeout-minutes: 5 timeout-minutes: 15
steps: steps:
- name: 'Wait Build workflow'
uses: fountainhead/action-wait-for-check@v1.0.0
id: wait-for-build
with:
token: ${{ secrets.GITHUB_TOKEN }}
checkName: 'main'
ref: ${{ github.event.pull_request.head.sha || github.sha }}
intervalSeconds: 20
- name: 'Check Build workflow status'
if: steps.wait-for-build.outputs.conclusion == 'failure'
run: |
exit 1
- name: 'Decontaminate previous build leftovers' - name: 'Decontaminate previous build leftovers'
run: | run: |
if [ -d .git ]; then if [ -d .git ]; then
@ -23,16 +43,18 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Get commit details' - name: 'Get commit details'
run: | run: |
export COMMIT_HASH=${{ github.event.client_payload.commit_hash }} if [[ ${{ github.event_name }} == 'pull_request' ]]; then
export COMMIT_MSG=${{ github.event.client_payload.commit_msg }} TYPE="pull"
export BRANCH_NAME=${{ github.event.client_payload.branch_name }} elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
if [[ ${{ github.event.client_payload.event_type }} == "pr" ]]; then TYPE="tag"
export PULL_ID=${{ github.event.client_payload.pull_id }} else
export PULL_NAME=${{ github.event.client_payload.pull_name }} TYPE="other"
fi fi
python3 scripts/get_env.py "--event_file=${{ github.event_path }}" "--type=$TYPE"
- name: 'Make artifacts directory' - name: 'Make artifacts directory'
run: | run: |
@ -47,13 +69,13 @@ jobs:
chmod 600 ./deploy_key; chmod 600 ./deploy_key;
rsync -avzP \ rsync -avzP \
-e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \ -e 'ssh -p ${{ secrets.RSYNC_DEPLOY_PORT }} -i ./deploy_key' \
${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${{ github.event.client_payload.branch_name }}/" artifacts/; ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${BRANCH_NAME}/" artifacts/;
rm ./deploy_key; rm ./deploy_key;
- name: 'Make .map file analyze' - name: 'Make .map file analyze'
run: | run: |
cd artifacts/ cd artifacts/
/Applications/amap/Contents/MacOS/amap -f flipper-z-f7-firmware-${{ github.event.client_payload.suffix }}.elf.map /Applications/amap/Contents/MacOS/amap -f "flipper-z-f7-firmware-${SUFFIX}.elf.map"
- name: 'Upload report to DB' - name: 'Upload report to DB'
run: | run: |
@ -77,5 +99,5 @@ jobs:
${{ secrets.AMAP_MARIADB_HOST }} \ ${{ secrets.AMAP_MARIADB_HOST }} \
${{ secrets.AMAP_MARIADB_PORT }} \ ${{ secrets.AMAP_MARIADB_PORT }} \
${{ secrets.AMAP_MARIADB_DATABASE }} \ ${{ secrets.AMAP_MARIADB_DATABASE }} \
artifacts/flipper-z-f7-firmware-${{ github.event.client_payload.suffix }}.elf.map.all artifacts/flipper-z-f7-firmware-$SUFFIX.elf.map.all

View File

@ -98,24 +98,6 @@ jobs:
artifacts/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${BRANCH_NAME}/"; artifacts/ ${{ secrets.RSYNC_DEPLOY_USER }}@${{ secrets.RSYNC_DEPLOY_HOST }}:"${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${BRANCH_NAME}/";
rm ./deploy_key; rm ./deploy_key;
- name: 'Trigger map file analyser'
if: ${{ (github.event_name != 'pull_request')
&& !github.event.pull_request.head.repo.fork }}
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: make_map_analyse
client-payload: '{"branch_name": "${{steps.names.outputs.branch_name}}", "commit_hash": "${{steps.names.outputs.commit_hash}}", "commit_msg": "${{steps.names.outputs.commit_msg}}", "event_type": "push"}'
- name: 'Trigger map file analyser'
if: ${{ (github.event_name == 'pull_request')
&& !github.event.pull_request.head.repo.fork }}
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: make_map_analyse
client-payload: '{"branch_name": "${{steps.names.outputs.branch_name}}", "commit_hash": "${{steps.names.outputs.commit_hash}}", "commit_msg": "${{steps.names.outputs.commit_msg}}", "pull_id": "${{steps.names.outputs.pull_id}}", "pull_name": "${{steps.names.outputs.pull_name}}", "event_type": "pr"}'
- name: 'Trigger update server reindex' - name: 'Trigger update server reindex'
if: ${{ !github.event.pull_request.head.repo.fork }} if: ${{ !github.event.pull_request.head.repo.fork }}
run: curl -X POST -F 'key=${{ secrets.REINDEX_KEY }}' ${{ secrets.REINDEX_URL }} run: curl -X POST -F 'key=${{ secrets.REINDEX_KEY }}' ${{ secrets.REINDEX_URL }}

View File

@ -89,18 +89,13 @@ def add_envs(data, gh_env_file, gh_out_file, args):
add_env("BRANCH_NAME", data["branch_name"], gh_env_file) add_env("BRANCH_NAME", data["branch_name"], gh_env_file)
add_env("DIST_SUFFIX", data["suffix"], gh_env_file) add_env("DIST_SUFFIX", data["suffix"], gh_env_file)
add_env("WORKFLOW_BRANCH_OR_TAG", data["branch_name"], gh_env_file) add_env("WORKFLOW_BRANCH_OR_TAG", data["branch_name"], gh_env_file)
add_set_output_var("commit_msg", data["commit_comment"], gh_out_file)
add_set_output_var("commit_hash", data["commit_hash"], gh_out_file)
add_set_output_var("commit_sha", data["commit_sha"], gh_out_file)
add_set_output_var("suffix", data["suffix"], gh_out_file)
add_set_output_var("branch_name", data["branch_name"], gh_out_file) add_set_output_var("branch_name", data["branch_name"], gh_out_file)
add_set_output_var("dist_suffix", data["suffix"], gh_out_file) add_set_output_var("commit_sha", data["commit_sha"], gh_out_file)
add_set_output_var("default_target", os.getenv("DEFAULT_TARGET"), gh_out_file) add_set_output_var("default_target", os.getenv("DEFAULT_TARGET"), gh_out_file)
add_set_output_var("suffix", data["suffix"], gh_out_file)
if args.type == "pull": if args.type == "pull":
add_env("PULL_ID", data["pull_id"], gh_env_file) add_env("PULL_ID", data["pull_id"], gh_env_file)
add_env("PULL_NAME", data["pull_name"], gh_env_file) add_env("PULL_NAME", data["pull_name"], gh_env_file)
add_set_output_var("pull_id", data["pull_id"], gh_out_file)
add_set_output_var("pull_name", data["pull_name"], gh_out_file)
def main(): def main():