gpt oss compatability #2118
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: ['main', 'develop', 'release/**', 'hotfix/**'] | |
pull_request: | |
branches: ['main', 'develop', 'release/**', 'hotfix/**', 'feature/**'] | |
permissions: | |
contents: read | |
jobs: | |
send_starting_slack_notification: | |
name: Send Starting Slack Notification | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Send Internal PR Created Notification | |
if: github.event_name == 'pull_request' && github.event.action == 'opened' | |
uses: rtCamp/action-slack-notify@cdf0a2130cbcdfd82ba5fcac8e076370bf381b36 # v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_TITLE: 'PR Created: ${{ github.event.pull_request.title }} by ${{ github.event.pull_request.user.login }}' | |
SLACK_FOOTER: '' | |
MSG_MINIMAL: true | |
SLACK_MESSAGE: 'PR Created ${{ github.event.pull_request.html_url }}' | |
- name: Send Mission Solution PR Created Notification | |
if: github.event_name == 'pull_request' && github.event.action == 'opened' | |
uses: rtCamp/action-slack-notify@cdf0a2130cbcdfd82ba5fcac8e076370bf381b36 # v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.MISSION_SOLUTION_PR_WEBHOOK }} | |
SLACK_TITLE: '${{github.event.repository.name}} PR Created: ${{ github.event.pull_request.title }} by ${{ github.event.pull_request.user.login }}' | |
SLACK_FOOTER: '' | |
MSG_MINIMAL: true | |
SLACK_MESSAGE: 'PR Created ${{ github.event.pull_request.html_url }}' | |
cdk-build: | |
name: CDK Tests | |
needs: [send_starting_slack_notification] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v4 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: | | |
npm ci | |
- name: Run tests | |
run: | | |
npm run test | |
backend-build: | |
name: Backend Tests | |
runs-on: ubuntu-latest | |
needs: [send_starting_slack_notification] | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
# Try hash-verified install first, fall back to regular | |
if [ -f "requirements-dev-hashes.txt" ]; then | |
pip install --require-hashes -r requirements-dev-hashes.txt | |
else | |
pip install -r requirements-dev.txt | |
fi | |
pip install -e ./lisa-sdk | |
- name: Run tests | |
run: | | |
make test-coverage | |
pre-commit: | |
name: Run All Pre-Commit | |
needs: [send_starting_slack_notification] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5 | |
with: | |
python-version: '3.11' | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v4 | |
with: | |
node-version: 20.x | |
- name: Install CDK dependencies | |
working-directory: ./ | |
run: | | |
npm ci | |
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
send_final_slack_notification: | |
name: Send Final Slack Notification | |
needs: [cdk-build, backend-build, pre-commit] | |
runs-on: ubuntu-latest | |
if: always() | |
permissions: | |
contents: read | |
steps: | |
- name: Send GitHub Action trigger data to Slack workflow | |
uses: rtCamp/action-slack-notify@cdf0a2130cbcdfd82ba5fcac8e076370bf381b36 # v2 | |
if: github.event_name != 'pull_request' | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_COLOR: ${{ contains(join(needs.*.result, ' '), 'failure') && 'failure' || 'success' }} | |
SLACK_TITLE: 'Build Finished' | |
SLACK_FOOTER: '' | |
MSG_MINIMAL: 'actions url,commit' | |
SLACK_MESSAGE_ON_FAILURE: '<!here> Build FAILED on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>' | |
SLACK_MESSAGE_ON_SUCCESS: 'Build SUCCESS on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>.' | |
SLACK_MESSAGE: 'Build Finished with status ${{ job.status }} on branch ${{ github.head_ref || github.ref_name }} for <${{ github.event.pull_request.html_url || github.event.head_commit.url }}|commit>' |