Skip to content

Add content check

Add content check #9

Workflow file for this run

# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
name: Run Consumer Tests on Comment
on: issue_comment
permissions:
checks: write
contents: read
pull-requests: read
jobs:
consumer_test:
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/consumer-test') }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2
- name: Run Consumer tests
id: consumer_tests
run: |
bazel run //src:ide_support
.venv/bin/python -m pytest -s -v src/tests/
- name: Report Consumer Tests Check
if: always()
uses: actions/github-script@v7
with:
script: |
const outcome = core.getInput('consumer_test_result');
const conclusion = outcome === 'success' ? 'success' :
outcome === 'skipped' ? 'neutral' : 'failure';
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: "Consumer Tests",
head_sha: context.sha,
status: "completed",
conclusion: conclusion,
output: {
title: "Consumer Tests Result",
summary: `The Consumer Tests step concluded with: ${conclusion}`
}
});
consumer_test_result: ${{ steps.consumer_tests.outcome }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}