Skip to content

Commit

Permalink
ci: Add build triggers and analysis step
Browse files Browse the repository at this point in the history
  • Loading branch information
petecheslock committed Sep 6, 2023
1 parent f0e67f8 commit 1eb2df2
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions .github/workflows/appmap-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: appmap-analysis

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 0 * * 0'

jobs:
record-appmaps:
Expand Down Expand Up @@ -48,10 +53,11 @@ jobs:
- name: Set matrix group env var with zero-based numbering
if: always()
id: set-matrix-group-var
env:
NUM: ${{ matrix.group }}
run: |
echo "ARCHIVE_ID=$(($NUM - 1))" >> $GITHUB_ENV
echo "ARCHIVE_ID=$(($NUM - 1))" >> $GITHUB_OUTPUT
- name: Delete Request AppMaps
if: always()
Expand All @@ -62,27 +68,39 @@ jobs:
if: always()
uses: getappmap/archive-action@v1
with:
archive-id: ${{ env.ARCHIVE_ID }}
archive-id: ${{ steps.set-matrix-group-var.outputs.ARCHIVE_ID }}

appmap-analysis:
if: always()
needs: [record-appmaps]

runs-on: ubuntu-latest
needs: [ record-appmaps ]
permissions:
contents: read
actions: read
checks: write
pull-requests: write

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Install AppMap tools
uses: getappmap/install-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
install-appmap-library: false

- name: Merge AppMaps
uses: getappmap/archive-action/merge@v1
with:
revision: ${{ github.event.pull_request.base.sha }}
revision: ${{ github.event.pull_request.head.sha }}
archive-count: 17

- name: Archive AppMaps
uses: getappmap/archive-action@v1
- name: Analyze AppMaps
uses: getappmap/analyze-action@v1
if: (success() || failure()) && github.event_name == 'pull_request'
with:
revision: ${{ github.event.pull_request.base.sha }}
base-revision: ${{ github.event.pull_request.base.sha }}
head-revision: ${{ github.event.pull_request.head.sha }}
github-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1eb2df2

Please sign in to comment.