chore: Migrate gsutil usage to gcloud storage #10
Workflow file for this run
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| # copier:raw | |
| name: Unit test & lint for User Management Service | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "components/common/**" | |
| - "components/user_management/**" | |
| - ".github/workflows/unit_test_linter_user_management.yaml" | |
| - ".pylintrc" | |
| - "!components/user_management/**.md" | |
| workflow_dispatch: | |
| env: | |
| PROJECT_ID: ${{ vars.PROJECT_ID }} | |
| NODE_VERSION: 18 | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| environment: develop | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.9] | |
| target-folder: [components/user_management] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # https://github.com/google-github-actions/auth | |
| - id: "auth" | |
| name: Auth with Service Account | |
| uses: "google-github-actions/auth@v1" | |
| with: | |
| credentials_json: "${{ secrets.GCP_CREDENTIALS }}" | |
| # workload_identity_provider: "${{ secrets.WI_PROVIDER }}" | |
| # service_account: "deployment@${{ env.PROJECT_ID }}.iam.gserviceaccount.com" | |
| - name: Set up Cloud SDK | |
| uses: "google-github-actions/setup-gcloud@v1" | |
| - name: Use Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{env.NODE_VERSION}} | |
| - name: Install Firebase CLI and emulator | |
| run: | | |
| utils/install_firebase.sh v13.1.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| BASE_DIR=$(pwd) | |
| python -m pip install --upgrade pip | |
| if [ -f $BASE_DIR/components/common/requirements.txt ]; then pip install -r $BASE_DIR/components/common/requirements.txt; fi | |
| if [ -f $BASE_DIR/components/common/requirements-test.txt ]; then pip install -r $BASE_DIR/components/common/requirements-test.txt; fi | |
| cd ${{ matrix.target-folder }} | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi | |
| - name: Run pytest with coverage | |
| run: | | |
| BASE_DIR=$(pwd) | |
| firebase emulators:start --only firestore --project fake-project & | |
| sleep 10 | |
| cd ${{ matrix.target-folder }}/src | |
| PYTEST_ADDOPTS="--cache-clear --cov . " PYTHONPATH=$BASE_DIR/components/common/src python -m pytest | |
| linter: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: [3.9] | |
| target-folder: [components/user_management] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pylint | |
| - name: Lint with pylint | |
| run: | | |
| BASE_DIR=$(pwd) | |
| cd ${{ matrix.target-folder }}/src | |
| python -m pylint $(git ls-files '*.py') --rcfile=$BASE_DIR/.pylintrc | |
| # copier:endraw |