forked from gardenlinux/gardenlinux
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (121 loc) · 4.31 KB
/
tests.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: tests
on:
workflow_call:
inputs:
version:
type: string
default: today
default_modifier:
type: string
default: ""
secrets:
gcp_identity_provider:
required: true
gcp_service_account:
required: true
gcp_project:
required: true
gcp_region:
required: true
gcp_zone:
required: true
aws_role:
required: true
aws_session:
required: true
aws_region:
required: true
az_client_id:
required: true
az_tenant_id:
required: true
az_subscription_id:
required: true
ccc_credentials:
required: true
jobs:
platform_tests:
name: platform test
env:
gcp_project: ${{ secrets.gcp_project }}
gcp_region: ${{ secrets.gcp_region }}
gcp_zone: ${{ secrets.gcp_zone }}
aws_region: ${{ secrets.aws_region }}
azure_subscription_id: ${{ secrets.az_subscription_id }}
AZURE_CONFIG_DIR: /tmp/azure_config_dir
TARGET_ARCHITECTURE: ${{ matrix.arch }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
id-token: write
packages: write
environment: oidc_platform_tests
strategy:
fail-fast: false
matrix:
arch: [ amd64, arm64 ]
target: [ gcp, aws, azure, ali ]
modifier: [ "${{ inputs.default_modifier }}" ]
exclude:
- arch: arm64
target: azure
- arch: arm64
target: ali
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # [email protected]
- name: login to ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u $ --password-stdin
- name: pull container image
run: |
podman pull "ghcr.io/gardenlinux/gardenlinux/integration-test:$GITHUB_SHA"
podman tag "ghcr.io/gardenlinux/gardenlinux/integration-test:$GITHUB_SHA" ghcr.io/gardenlinux/gardenlinux/integration-test:today
- name: set VERSION=${{ inputs.version }}
run: |
bin/garden-version "${{ inputs.version }}" | tee VERSION
git update-index --assume-unchanged VERSION
- name: get cname
run: echo "cname=$(./build --resolve-cname ${{ matrix.target }}${{ matrix.modifier }}-${{ matrix.arch }})" | tee -a "$GITHUB_ENV"
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # pin@v3
with:
name: ${{ env.cname }}
path: /tmp/gardenlinux-build-artifacts
- run: ls -lah /tmp/gardenlinux-build-artifacts
- if: ${{ matrix.target == 'gcp' }}
id: 'auth_gcp'
name: 'Authenticate to Google Cloud'
uses: google-github-actions/auth@f6de81663f7788d05bd15bcce18f0e57f23f0846 # pin@v1
with:
workload_identity_provider: ${{ secrets.gcp_identity_provider }}
service_account: ${{ secrets.gcp_service_account }}
create_credentials_file: true
cleanup_credentials: true
export_environment_variables: true
- if: ${{ matrix.target == 'aws' }}
id: 'auth_aws'
name: 'Authenticate to AWS'
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # pin@v4
with:
role-to-assume: ${{ secrets.aws_role }}
role-session-name: ${{ secrets.aws_session }}
aws-region: ${{ secrets.aws_region }}
- if: ${{ matrix.target == 'azure' }}
id: 'auth_azure'
name: 'Authenticate to Azure'
uses: azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # pin@v1
with:
client-id: ${{ secrets.az_client_id }}
tenant-id: ${{ secrets.az_tenant_id }}
subscription-id: ${{ secrets.az_subscription_id }}
- if: ${{ matrix.target == 'ali' }}
name: 'Create ali cloud credential file'
run: base64 -d <<< "${{ secrets.ccc_credentials }}" | .github/workflows/ali_credentials.jq > ali-service-account.json
- name: start platform test for ${{ matrix.target }}
run: |
set -o pipefail
.github/workflows/${{ matrix.target }}_tests.sh --arch "${{ matrix.arch }}" "${{ env.cname }}" 2>&1 | tee "${{ env.cname }}.integration-tests-log"
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # pin@v3
with:
name: tests-${{ env.cname }}
path: ${{ env.cname }}.integration-tests-log