add PR check #16
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: Monthly Notebook Check | |
on: | |
# schedule: | |
# - cron: '0 8 1 * *' # Every month on the 1st at 08:00 UTC | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- chienyuanchang/test_github_actions | |
workflow_dispatch: # Allows manual run from GitHub UI | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
test-notebooks: | |
runs-on: ubuntu-latest | |
environment: MMI-Samples | |
env: | |
AZURE_AI_ENDPOINT: ${{ secrets.AZURE_CONTENT_UNDERSTANDING_ENDPOINT }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install nbformat nbconvert jupyter ipykernel | |
# python -m ipykernel install --user --name=python3 | |
- name: List notebook files | |
run: ls -la notebooks | |
- name: Azure Login | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Pull LFS files | |
run: git lfs pull | |
- name: Run notebook tests | |
run: | | |
set -e | |
python tools/test_notebooks/test_notebooks.py |