pin numpy version #193
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: AutoMLOps CI Workflow | |
on: | |
push: | |
branches: | |
- main | |
- first-integration-test | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
branches: | |
- main | |
jobs: | |
lint-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Python dependencies | |
run: | # force numpy to be latest non 2.x version due to incompatibility with google-cloud-aiplatform | |
python3 -m pip install --upgrade pip | |
pip3 install numpy==1.26.4 | |
pip3 install -r requirements.txt | |
- name: Check for licenses | |
run: | | |
./license_check.sh | |
- name: Lint with pylint | |
run: | | |
pylint --jobs=0 $(git ls-files '*.py') --ignore-paths=example --rcfile=.pylintrc | |
unit-tests: | |
needs: [lint-checks] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Python dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install -r requirements.txt | |
- name: Run unit tests | |
run: | | |
pytest tests/unit --cov=AutoMLOps= | |
integration-tests: | |
needs: [lint-checks, unit-tests] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Python dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install -r requirements.txt | |
- name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
token_format: 'access_token' | |
workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}' | |
service_account: '${{ secrets.INTEGRATION_TEST_SERVICE_ACCOUNT }}' | |
project_id: '${{ secrets.INTEGRATION_TEST_PROJECT_ID }}' | |
- name: "Set up Cloud SDK" | |
uses: 'google-github-actions/setup-gcloud@v2' | |
with: | |
project_id: '${{ secrets.INTEGRATION_TEST_PROJECT_ID }}' | |
install_components: 'beta' | |
- name: 'Install AMO locally' | |
run: | | |
pip install . | |
# Set the working directory to test/integration to contain the generated files | |
# TODO move this to a temp directory | |
- name: 'Install integration test-specific dependencies' | |
run: | | |
pip3 install google-cloud-aiplatform | |
- name: Run integration tests | |
working-directory: tests/integration | |
env: | |
PROJECT_ID: ${{ secrets.INTEGRATION_TEST_PROJECT_ID }} | |
run: | | |
pytest --cov=AutoMLOps= |