feat: support CloudSSO & OAuth credentials provider #126
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: Python Test | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| id-token: write | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: pip install alibabacloud-tea coverage pytest alibabacloud_credentials_api APScheduler aiofiles | |
| - name: Setup OIDC | |
| run: npm install @actions/[email protected] @actions/http-client | |
| - name: Get Id Token | |
| uses: actions/github-script@v6 | |
| id: idtoken | |
| with: | |
| script: | | |
| const coreDemo = require('@actions/core'); | |
| const idToken = await coreDemo.getIDToken('sts.aliyuncs.com'); | |
| const fsx = require('fs/promises'); | |
| await fsx.writeFile('/tmp/oidc_token', idToken); | |
| - name: Test with unittest | |
| run: | | |
| coverage run -m unittest discover | |
| env: | |
| SUB_ALIBABA_CLOUD_ACCESS_KEY: ${{ secrets.SUB_ALIBABA_CLOUD_ACCESS_KEY }} | |
| SUB_ALIBABA_CLOUD_SECRET_KEY: ${{ secrets.SUB_ALIBABA_CLOUD_SECRET_KEY }} | |
| SUB_ALIBABA_CLOUD_ROLE_ARN: ${{ secrets.ALIBABA_CLOUD_ROLE_ARN }} | |
| ALIBABA_CLOUD_ROLE_ARN: ${{ secrets.OIDC_ROLE_ARN }} | |
| ALIBABA_CLOUD_ROLE_SESSION_NAME: ${{ secrets.ALIBABA_CLOUD_ROLE_SESSION_NAME }} | |
| ALIBABA_CLOUD_OIDC_TOKEN_FILE: "/tmp/oidc_token" | |
| ALIBABA_CLOUD_OIDC_PROVIDER_ARN: ${{ secrets.OIDC_PROVIDER_ARN }} | |
| - name: Upload Coverage Report | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # required | |
| build-win: | |
| runs-on: windows-2025 | |
| strategy: | |
| matrix: | |
| python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: pip install alibabacloud-tea coverage pytest alibabacloud_credentials_api APScheduler aiofiles | |
| - name: Setup OIDC | |
| run: npm install @actions/[email protected] @actions/http-client | |
| - name: Get Id Token | |
| uses: actions/github-script@v6 | |
| id: idtoken | |
| with: | |
| script: | | |
| const coreDemo = require('@actions/core'); | |
| const idToken = await coreDemo.getIDToken('sts.aliyuncs.com'); | |
| const fsx = require('fs/promises'); | |
| await fsx.writeFile('D:\\oidc_token', idToken); | |
| - name: Test with unittest | |
| run: | | |
| coverage run -m unittest discover | |
| env: | |
| SUB_ALIBABA_CLOUD_ACCESS_KEY: ${{ secrets.SUB_ALIBABA_CLOUD_ACCESS_KEY }} | |
| SUB_ALIBABA_CLOUD_SECRET_KEY: ${{ secrets.SUB_ALIBABA_CLOUD_SECRET_KEY }} | |
| SUB_ALIBABA_CLOUD_ROLE_ARN: ${{ secrets.ALIBABA_CLOUD_ROLE_ARN }} | |
| ALIBABA_CLOUD_ROLE_ARN: ${{ secrets.OIDC_ROLE_ARN }} | |
| ALIBABA_CLOUD_ROLE_SESSION_NAME: ${{ secrets.ALIBABA_CLOUD_ROLE_SESSION_NAME }} | |
| ALIBABA_CLOUD_OIDC_TOKEN_FILE: "D:\\oidc_token" | |
| ALIBABA_CLOUD_OIDC_PROVIDER_ARN: ${{ secrets.OIDC_PROVIDER_ARN }} | |
| - name: Upload Coverage Report | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # required |