Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Bump transformers from 4.30.0 to 4.36.0 in /tests/semantic_segmentation_course #214

Bump transformers from 4.30.0 to 4.36.0 in /tests/semantic_segmentation_course

Bump transformers from 4.30.0 to 4.36.0 in /tests/semantic_segmentation_course #214

name: Pull request test
on:
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
get-edited-notebooks:
runs-on: ubuntu-latest
name: Get edited notebooks
outputs:
edited_notebooks: ${{ steps.output.outputs.changed_files }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v34
with:
json: true
files: |
**/*.ipynb
- name: Set output
id: output
if: steps.changed-files.outputs.any_changed == 'true'
run: echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT"
test-notebooks:
name: Test edited notebooks
needs: get-edited-notebooks
if: ${{ needs.get-edited-notebooks.outputs.edited_notebooks }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
notebooks: ${{ fromJSON(needs.get-edited-notebooks.outputs.edited_notebooks) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "tests/semantic_segmentation_course/requirements.txt"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "tests/semantic_segmentation_course/requirements.txt"
- name: Run notebooks
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 2
retry_on: timeout
command: |
echo "run ${{ matrix.notebooks }}"
ipython ${{ matrix.notebooks }}
get-edited-scripts:
runs-on: ubuntu-latest
name: Get edited scripts
outputs:
edited_scripts: ${{ steps.output.outputs.changed_files }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v34
with:
json: true
files: |
**/*.py
- name: Set output
id: output
if: steps.changed-files.outputs.any_changed == 'true'
run: echo "changed_files=${{ steps.changed-files.outputs.all_changed_files }}" >> "$GITHUB_OUTPUT"
test-scripts:
name: Test edited scripts
needs: get-edited-scripts
if: ${{ needs.get-edited-scripts.outputs.edited_scripts }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
scripts: ${{ fromJSON(needs.get-edited-scripts.outputs.edited_scripts) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "tests/semantic_segmentation_course/requirements.txt"
- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
with:
path: "tests/semantic_segmentation_course/requirements.txt"
- name: Run scripts
uses: nick-fields/retry@v2
with:
timeout_minutes: 40
max_attempts: 2
retry_on: timeout
command: |
echo "run ${{ matrix.scripts }}"
python ${{ matrix.scripts }}