Generated 2016-11-01 for live. #521
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: Go | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
permissions: | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: ci | |
strategy: | |
fail-fast: false | |
matrix: | |
go-version: ['1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Unit Test | |
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./sdk/... | |
- name: Upload Coverage Report | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
- name: Setup OIDC | |
run: npm install @actions/core@1.6.0 @actions/http-client | |
- name: Get ID Token | |
uses: actions/github-script@v6 | |
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: Integration Test | |
env: | |
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }} | |
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }} | |
REGION_ID: ${{ vars.REGION_ID }} | |
USER_ID: ${{ secrets.USER_ID }} | |
PUBLIC_KEY_ID: ${{ secrets.PUBLIC_KEY_ID }} | |
RSA_FILE_AES_KEY: ${{ secrets.RSA_FILE_AES_KEY }} | |
CONCURRENT_ID: "${{ github.run_number }}-${{ strategy.job-index }}" | |
# for OIDC | |
ALIBABA_CLOUD_OIDC_PROVIDER_ARN: ${{ secrets.OIDC_PROVIDER_ARN }} | |
ALIBABA_CLOUD_OIDC_TOKEN_FILE: "/tmp/oidc_token" | |
ALIBABA_CLOUD_ROLE_ARN: ${{ secrets.OIDC_ROLE_ARN }} | |
run: test -z $ACCESS_KEY_ID -a -z $ACCESS_KEY_SECRET || go test -v -timeout 120s ./integration/... |