Skip to content
Open
Show file tree
Hide file tree
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
30 changes: 30 additions & 0 deletions .github/workflows/presubmits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: json-yaml-validate
on:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
validate-signals:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Checkout schemas repo
uses: actions/checkout@v4
with:
repository: OBDb/.schemas
path: .schemas

- name: Validate signalsets
id: json-yaml-validate-v3
uses: GrantBirki/json-yaml-validate@v2.7.1
with:
comment: "true"
base_dir: signalsets/v3/
json_schema: .schemas/signals.json
65 changes: 65 additions & 0 deletions .github/workflows/response_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Response tests

on:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run tests in devcontainer
id: test
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/obdb/devcontainer
push: never
env: |
GITHUB_SERVER_URL=${{ github.server_url }}
GITHUB_REPOSITORY=${{ github.repository }}
GITHUB_SHA=${{ github.sha }}
GITHUB_RUN_ID=${{ github.run_id }}
runCmd: |
pytest tests/ --ignore=tests/schemas -xvs -n auto > ./test-output.txt 2>&1
TEST_EXIT=$?
cat ./test-output.txt

# Format results for PR comment with all required arguments
/usr/local/bin/format-test-results.sh \
test-output.txt \
$TEST_EXIT \
"$GITHUB_SERVER_URL" \
"$GITHUB_REPOSITORY" \
"$GITHUB_SHA" \
"$GITHUB_RUN_ID" \
> ./test-results.md || true

# Exit with the actual test result
exit $TEST_EXIT

- name: Set test results output
if: always() && github.event_name == 'pull_request'
run: |
if [ -f test-results.md ]; then
{
echo 'TEST_RESULTS<<EOFMARKER'
cat test-results.md
echo 'EOFMARKER'
} >> $GITHUB_ENV
fi

- name: Comment test results on PR
if: always() && github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
message: ${{ env.TEST_RESULTS }}
comment_tag: response-tests
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
build/
__pycache__/
workspace/
node_modules
tests/schemas/
__pycache__
.claude/skills
.claude/settings.local.json
tests/*.py
.vscode/*.json
Loading