Skip to content

style: add action branding #13

style: add action branding

style: add action branding #13

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
jobs:
no-inputs:
name: Test ai-digest action without inputs
runs-on: ubuntu-latest
env:
OUTPUT_FILE: codebase.md
DIGEST_LOG: ingest.md
steps:
- uses: actions/checkout@v4
with:
path: ai-digest
clean: true
- name: Run action
id: run_action
uses: ./ai-digest
- name: Check output files exist
run: |
test -f ${{ env.OUTPUT_FILE }}
test -f ${{ env.DIGEST_LOG }}
- name: Check outputs
run: |
test ${{ steps.run_action.outputs.included_files }} -gt 0
test ${{ steps.run_action.outputs.estimated_tokens }} -gt 0
test ${{ steps.run_action.outputs.binary_files }} -eq 0
test ${{ steps.run_action.outputs.total_files }} -gt 0
- name: Check files are listed in output
run: |
cat ${{ env.DIGEST_LOG }} | grep 'Files included in the output:'
cat ${{ env.DIGEST_LOG }} | grep 'README.md'
- name: Check whitespace-removal is applied
run: |
cat ${{ env.DIGEST_LOG }} | grep 'Whitespace removal enabled'
all-inputs:
name: Test ai-digest action with inputs
runs-on: ubuntu-latest
env:
OUTPUT_FILE: workflows.md
DIGEST_LOG: workflows-ingest.md
steps:
- uses: actions/checkout@v4
with:
path: ai-digest
clean: true
- name: Run action
id: run_action
uses: ./ai-digest
with:
input_path: './ai-digest/.github/workflows'
output_file: ${{ env.OUTPUT_FILE }}
digest_log: ${{ env.DIGEST_LOG }}
ai_digest_flags: ''
- name: Check output files exist
run: |
test -f ${{ env.OUTPUT_FILE }}
test -f ${{ env.DIGEST_LOG }}
- name: Check outputs
run: |
test ${{ steps.run_action.outputs.included_files }} -gt 0
test ${{ steps.run_action.outputs.estimated_tokens }} -gt 0
test ${{ steps.run_action.outputs.binary_files }} -eq 0
test ${{ steps.run_action.outputs.total_files }} -gt 0
- name: Check files are not listed
run: |
test -z "$(cat ${{ env.DIGEST_LOG }} | grep 'Files included in the output:')"
- name: Check whitespace-removal is not applied
run: |
test -z "$(cat ${{ env.DIGEST_LOG }} | grep 'Whitespace removal enabled')"