Skip to content

Create __init__.py file in root directory for correct package installation #1221

Create __init__.py file in root directory for correct package installation

Create __init__.py file in root directory for correct package installation #1221

name: Continuous Integration
on:
push:
pull_request_target:
types: [opened, synchronize, reopened, labeled]
permissions:
id-token: write
contents: read
issues: write # for peter-evans/create-or-update-comment on the PR
pull-requests: write # for peter-evans/create-or-update-comment on the PR
jobs:
permission_check:
runs-on: ubuntu-latest
steps:
- name: Check for Actor Permission
id: check
continue-on-error: true
uses: prince-chrismc/check-actor-permissions-action@v3
with:
github_token: ${{ github.token }}
permission: write
- name: Debug Information
if: ${{ github.event_name == 'pull_request_target' }}
run: |
echo "Event Name: ${{ github.event_name }}"
echo "Labels: ${{ toJson(github.event.pull_request.labels) }}"
echo "Permitted: ${{ steps.check.outputs.permitted }}"
echo "Safe to Test Label Present: ${{ contains(github.event.pull_request.labels.*.name, 'safe to test') }}"
- name: Check PR Safe to Run
if: ${{ github.event_name == 'pull_request_target' && !contains(github.event.pull_request.labels.*.name, 'safe to test') && steps.check.outputs.permitted == 'false' }}
run: exit 1
- name: Remove Safe to Test Label # One commit is safe doesn't mean the next commit is safe.
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions-ecosystem/action-remove-labels@v1.3.0
with:
labels: 'safe to test'
lint_check:
runs-on: ubuntu-latest
needs: permission_check
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v4
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Lint Check
run: |
chmod +x ./.github/workflow_scripts/lint_check.sh && ./.github/workflow_scripts/lint_check.sh
run_tests:
needs: lint_check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v4
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Run AutoGluon-RAG Tests
run: |
chmod +x ./.github/workflow_scripts/test_agrag.sh && ./.github/workflow_scripts/test_agrag.sh
build_doc:
if: ${{ github.event_name != 'schedule' }}
needs: [run_tests]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v4
- name: Checkout repository(Pull Request Target)
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Env Vars
uses: ./.github/actions/setup-env-vars
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: r-lib/actions/setup-pandoc@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::369469875935:role/AutoGluonRAGCIDocRole
role-duration-seconds: 3600
aws-region: us-east-1
- name: Build Doc(For push)
if: ${{ github.event_name == 'push' }}
run: |
chmod +x ./.github/workflow_scripts/build_doc.sh
./.github/workflow_scripts/build_doc.sh '${{ github.ref }}' '${{ github.repository }}' '${{ env.SHORT_SHA }}'
- name: Build Doc(For pull request)
if: ${{ github.event_name == 'pull_request_target' }}
env:
branch: ${{ github.event.pull_request.head.ref }}
run: |
chmod +x ./.github/workflow_scripts/build_doc.sh
./.github/workflow_scripts/build_doc.sh "$branch" '${{ github.event.pull_request.head.repo.full_name }}' '${{ env.SHORT_SHA }}' PR-'${{ github.event.number }}'
- name: Comment on PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
body: |
Job PR-${{ github.event.number }}-${{ env.SHORT_SHA }} is done.
Docs are uploaded to https://d1at46xkvcde0c.cloudfront.net/PR-${{ github.event.number }}/${{ env.SHORT_SHA }}/index.html