Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add test action and output validation #147

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/code-test.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ name: Code Test

on:
push:
branches: [main]
branches: [main, "!release-please-*"]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

@@ -56,3 +56,20 @@ jobs:

- name: Validate Schema
run: just validate-schema

test-action:
name: Test Action
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run GitHub Stats Analyser (pre-built image)
uses: ./
with:
REPOSITORY_OWNER: ${{ github.REPOSITORY_OWNER }}

- name: Test Output
run: test/test_output.sh
8 changes: 8 additions & 0 deletions test/test_output.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e +x

# check file exists
test -f repository_statistics.json

# check file is not empty
test -s repository_statistics.json