-
Notifications
You must be signed in to change notification settings - Fork 1.1k
64 lines (60 loc) · 1.92 KB
/
maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
defaults:
run:
shell: bash
permissions:
id-token: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 8, 11 ]
name: Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Test with Maven
run: mvn test -B -f ./aliyun-java-sdk-core/pom.xml
- 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
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: Integration Test
if: ${{ env.ACCESS_KEY_ID != '' }}
run: |
npm i o_o -g
o_o &
make functional-test
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
RAMAccessKeyId: ${{ secrets.RAM_ACCESS_KEY_ID }}
RAMAccessKeySecret: ${{ secrets.RAM_ACCESS_KEY_SECRET }}
roleArn: ${{ secrets.ROLE_ARN }}
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 }}