diff trigger test - correcting notebooks to run list formatting #7
Workflow file for this run
This file contains 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: Test Library CI | |
on: | |
# Trigger the workflow on push to the specific branch | |
push: | |
branches: | |
- Nadav/CAD-22801/create_CI-library_workflow | |
# Trigger the workflow on pull requests targeting the specific branch | |
pull_request: | |
branches: | |
- Nadav/CAD-22801/create_CI-library_workflow | |
# Add a manual trigger option for running the workflow | |
workflow_dispatch: | |
jobs: | |
test: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
PROD_M2M_SECRET_ARN: ${{ secrets.PROD_M2M_SECRET_ARN }} # Passing secrets | |
NIGHTLY_M2M_SECRET_ARN: ${{ secrets.NIGHTLY_M2M_SECRET_ARN }} # Passing secrets | |
AWS_ROLE: ${{ secrets.AWS_ROLE }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Step to detect changed .ipynb files | |
- name: Get changed notebook files | |
id: changed-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
**/*.ipynb | |
# Create a comma-separated list of notebooks | |
- name: Create comma-separated list of notebooks | |
run: | | |
if [ -n "${{ steps.changed-files.outputs.all_changed_files }}" ]; then | |
notebooks=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' ',') | |
echo "NOTEBOOKS_TO_RUN=$notebooks" >> $GITHUB_ENV | |
else | |
echo "No notebooks changed." | |
fi | |
# Configure AWS Credentials | |
- name: Configure AWS Credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: ${{ env.AWS_ROLE }} | |
aws-region: us-east-1 | |
mask-aws-account-id: true | |
# Run notebook tests if any changed notebooks are detected | |
- name: Run notebook tests | |
if: steps.changed-files.outputs.any_changed == 'true' | |
uses: ./.github/actions/run-tests # Calls your composite action | |
with: | |
env: dev # Example environment | |
notebooks: ${{ env.NOTEBOOKS_TO_RUN }} # Pass the comma-separated list of notebooks | |
prod_m2m_secret_arn: ${{ env.PROD_M2M_SECRET_ARN }} | |
nightly_m2m_secret_arn: ${{ env.NIGHTLY_M2M_SECRET_ARN }} | |
aws_role: ${{ env.AWS_ROLE }} | |
# Optionally print the list of changed notebooks | |
- name: Print changed notebooks | |
if: steps.changed-files.outputs.any_changed == 'true' | |
run: | | |
echo "Changed notebooks:" | |
echo "${{ env.NOTEBOOKS_TO_RUN }}" |