Skip to content

Commit

Permalink
Merge pull request #16 from getappmap/feat/fetch-history
Browse files Browse the repository at this point in the history
feat: Deepen the git fetch depth as needed
  • Loading branch information
kgilpin authored Jul 14, 2023
2 parents 1a91d8d + 1e20415 commit 28760b7
Show file tree
Hide file tree
Showing 17 changed files with 418 additions and 137 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/appmap-archive.yml

This file was deleted.

41 changes: 21 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: CI

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

env:
APPMAP_TELEMETRY_DISABLED: 'true'
Expand All @@ -12,40 +17,36 @@ jobs:
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.24/appmap-preflight-linux-x64
chmod a+x /usr/local/bin/appmap
- name: Install AppMap
uses: getappmap/[email protected]
with:
verbose: true

- name: Build
run: yarn build

- name: Test
run: yarn test

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

- 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
with:
add: dist
message: 'chore: Packaged distribution of the GitHub action'

- name: Archive AppMaps
uses: getappmap/[email protected]
if: github.event_name != 'pull_request'

- name: Analyze AppMaps
uses: ./
if: (success() || failure()) && github.event_name == 'pull_request'
with:
base-revision: origin/main
head-revision: ${{ github.event.pull_request.head.sha }}
github-token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ inputs:
description: |
The GitHub token to use with the GitHub API to pull AppMap archives from build artifacts.
Most commonly, you'll use `secrets.GITHUB_TOKEN`, which is automatically provided by GitHub.
fetch-history-days:
description: |
The number of days of history to fetch in order to find the most recent ancestor that has
an AppMap archive. The default is 30 days. If an archive is not found, within this time window,
the entire history will be fetched. To disable history fetching completely, set this value to 0.
verbose:
description: Enable verbose logging.
default: 'false'
Expand Down
Loading

0 comments on commit 28760b7

Please sign in to comment.