Skip to content

Commit

Permalink
Merge pull request #12 from getappmap/feat/check
Browse files Browse the repository at this point in the history
feat: Check
  • Loading branch information
kgilpin authored May 18, 2023
2 parents 46c4eff + 2e21e6b commit 8556a45
Show file tree
Hide file tree
Showing 25 changed files with 13,847 additions and 5,469 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/appmap-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@ env:
APPMAP_TELEMETRY_DISABLED: 'true'

jobs:
appmap_archive_main:
appmap_archive:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout step
uses: actions/checkout@v3

- name: Install dependencies
run: yarn install
- name: Install and configure AppMap
uses: getappmap/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
verbose: true

- name: Install AppMap tools
run: |
curl -o /usr/local/bin/appmap -L https://github.com/getappmap/appmap-js/releases/download/%40appland%2Fappmap-preflight-v1.0-pre.19/appmap-preflight-linux-x64
chmod a+x /usr/local/bin/appmap
ln -s /usr/local/bin/appmap /tmp/appmap
- name: Build AppMaps
run: yarn appmap

- name: Archive AppMaps
uses: getappmap/[email protected]
with:
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,48 @@ env:
APPMAP_TELEMETRY_DISABLED: 'true'

jobs:
appmap_archive_main:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# This is needed to see the version history, because
# checkout action doesn't fetch the base or head branches
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Install dependency libraries
run: yarn install

- name: Install AppMap tools
run: |
curl -o /usr/local/bin/appmap -L https://github.com/getappmap/appmap-js/releases/download/%40appland%2Fappmap-preflight-v1.0-pre.19/appmap-preflight-linux-x64
chmod a+x /usr/local/bin/appmap
ln -s /usr/local/bin/appmap /tmp/appmap
- name: Build
run: yarn build

- name: Test
run: yarn test
run: yarn appmap || true

- name: Preflight
id: preflight
uses: ./
with:
base-revision: origin/main
head-revision: ${{ github.event.pull_request.head.sha }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check test status
uses: ./check
with:
directory: ${{ steps.preflight.outputs.report-dir }}

- name: Build GitHub action
run: yarn package

- name: Commit changes
# If you forgot to package the distribution, you'll see a commit added to your PR
uses: EndBug/add-and-commit@v7
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/preflight.yml

This file was deleted.

10 changes: 7 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build a preflight report for a repository.
name: AppMap Preflight
description: Build a preflight report for a repository.
inputs:
base-revision:
description: |
Expand All @@ -14,7 +15,10 @@ inputs:
Most commonly, you'll use `secrets.GITHUB_TOKEN`, which is automatically provided by GitHub.
verbose:
description: Enable verbose logging.
default: false
default: 'false'
outputs:
report-dir:
description: Directory containing the report files.
runs:
using: 'node16'
main: 'dist/index.js'
main: 'dist/preflight/index.js'
14 changes: 14 additions & 0 deletions check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Check test status after AppMap preflight
description: |
This action verifies that all test cases have passed. If any test cases have failed, the action
will fail. It checks the test case succeeded / failed status by examining the JSON report
file created by the `preflight` action.
inputs:
directory:
description: |
Directory containing the JSON report file. This is most easily obtained as the
`report-dir` output of the preflight action.
required: true
runs:
using: 'node16'
main: '../dist/check/index.js'
Loading

0 comments on commit 8556a45

Please sign in to comment.