Repository navigation
Expand file tree
/
Copy pathidentity-github-actions-credential.yml
More file actions
66 lines (59 loc) · 1.99 KB
/
Copy pathidentity-github-actions-credential.yml
File metadata and controls
66 lines (59 loc) · 1.99 KB
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
65
66
name: Identity GitHub Actions credential
on:
push:
branches:
- vcolin7-github-actions-credential
workflow_dispatch:
permissions:
contents: read
jobs:
authenticate:
name: ${{ matrix.package }}
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
include:
- package: com.azure:azure-identity
pom: sdk/identity/azure-identity/pom.xml
- package: com.azure.v2:azure-identity
pom: sdk/identity-v2/azure-identity/pom.xml
env:
AZURE_TENANT_ID: ${{ vars.AZURE_IDENTITY_GITHUB_ACTIONS_TENANT_ID }}
AZURE_CLIENT_ID: ${{ vars.AZURE_IDENTITY_GITHUB_ACTIONS_CLIENT_ID }}
AZURE_TEST_MODE: LIVE
RUN_GITHUB_ACTIONS_CREDENTIAL_LIVE_TESTS: 'true'
SDK_COORDINATES: ${{ matrix.package }}
SDK_POM: ${{ matrix.pom }}
steps:
- name: Check test identity configuration
shell: bash
run: |
if [[ -z "$AZURE_TENANT_ID" || -z "$AZURE_CLIENT_ID" ]]; then
echo "::error::Set AZURE_IDENTITY_GITHUB_ACTIONS_TENANT_ID and AZURE_IDENTITY_GITHUB_ACTIONS_CLIENT_ID repository variables."
exit 1
fi
- name: Checkout code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Set up JDK 25
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: temurin
java-version: '25'
cache: maven
- name: Build the selected SDK and its dependencies
shell: bash
run: >
mvn -B -ntp -f pom.xml -pl "$SDK_COORDINATES" -am
install -DskipTests -Djacoco.skip=true -Dgpg.skip=true
- name: Authenticate through GitHub OIDC and Microsoft Entra
shell: bash
run: >
mvn -B -ntp -f "$SDK_POM"
test -Dtest=GitHubActionsCredentialLiveTest