Merge pull request #1 from udacity/content #1
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: Fairness Check | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "module-27-fairlearn/**" | |
| jobs: | |
| fairness-check: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: module-27-fairlearn/solution | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: pip-fairlearn-${{ hashFiles('module-27-fairlearn/solution/requirements.txt') }} | |
| # TODO: Install dependencies from requirements.txt | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| # TODO: Run the fairness gate against the pre-trained model artifacts | |
| # (model.joblib, X_test.npy, y_test.npy, sf_test.csv). | |
| # Run train.py locally first to generate these files and commit them. | |
| # Exits with code 1 if any fairness metric exceeds its threshold. | |
| - name: Run fairness gate | |
| run: python check_fairness.py | |
| # TODO: Upload fairness_report.json as a downloadable artifact (even on failure) | |
| - name: Upload fairness report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fairness-report | |
| path: module-27-fairlearn/solution/fairness_report.json | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: fairness-check | |
| steps: | |
| # TODO: Add deployment steps here — this job only runs if fairness-check passes | |
| - name: Deploy model | |
| run: echo "Fairness checks passed... deploying model." |