set up secrets #182
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@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install Python dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
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@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
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@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
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.WorkloadIdentityProvider }} | |
service_account: ${{ secrets.IntegrationTestServiceAccount }} | |
project_id: ${{ secrets.IntegrationTestProjectId }} | |
- name: 'Configure gcloud' | |
run: tests/integration/configure-gcloud.sh ${{ secrets.IntegrationTestProjectId }} | |
- 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: Run integration tests | |
working-directory: tests/integration | |
env: | |
PROJECT_ID: ${{ secrets.IntegrationTestProjectId }} | |
run: | | |
pytest --cov=AutoMLOps= |