-
Notifications
You must be signed in to change notification settings - Fork 34
141 lines (136 loc) · 4.46 KB
/
test.yaml
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
134
135
136
137
138
139
140
141
name: test
on:
push:
paths-ignore:
- README.md
workflow_dispatch:
jobs:
dispatch_test_action:
name: Dispatch Test Action
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Workflow Dispatch Status
uses: unfor19/hero-action@master
with:
action: "dispatch-status"
src_repository: ${{ github.repository }}
src_workflow_name: ${{ github.workflow }}
src_sha: ${{ github.sha }}
target_repository: ${{ github.repository }}-test
target_workflow_name: "test-action.yml"
gh_token: ${{ secrets.GH_TOKEN }} # scope: repo + workflow
test_dirs:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- TEST_NAME: "ROOTDIR v2"
AWS_CLI_VERSION: "2"
ROOTDIR: "/tmp"
- TEST_NAME: "WORKDIR v2"
AWS_CLI_VERSION: "2"
WORKDIR: "/tmp/unfor19-awscli"
- TEST_NAME: "ROOTDIR v1"
AWS_CLI_VERSION: "1"
ROOTDIR: "/tmp"
- TEST_NAME: "WORKDIR v1"
AWS_CLI_VERSION: "1"
WORKDIR: "/tmp/unfor19-awscli"
- TEST_NAME: "BINDIR v2"
AWS_CLI_VERSION: "2"
BINDIR: "/tmp/aws/bin"
- TEST_NAME: "INSTALLROOTDIR v2"
AWS_CLI_VERSION: "2"
INSTALLROOTDIR: "/tmp/aws"
name: Test ${{ matrix.TEST_NAME }}
steps:
- uses: actions/checkout@v3
- name: Test On Runner
env:
AWS_CLI_VERSION: "${{ matrix.AWS_CLI_VERSION}}"
AWS_CLI_ARCH: "${{ matrix.AWS_CLI_ARCH }}"
ROOTDIR: "${{ matrix.ROOTDIR }}"
WORKDIR: "${{ matrix.WORKDIR }}"
BINDIR: "${{ matrix.BINDIR }}"
INSTALLROOTDIR: "${{ matrix.INSTALLROOTDIR }}"
run: |
sudo --preserve-env ./entrypoint.sh
test_amd64:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- TEST_NAME: "Latest v2"
AWS_CLI_VERSION: "2"
- TEST_NAME: "Specific v2"
AWS_CLI_VERSION: "2.0.30"
- TEST_NAME: "Latest v1"
AWS_CLI_VERSION: "1"
- TEST_NAME: "Specific v1"
AWS_CLI_VERSION: "1.16.312"
- TEST_NAME: "No Input"
name: Test amd64 ${{ matrix.TEST_NAME }} ${{ matrix.AWS_CLI_VERSION}}
steps:
- uses: actions/checkout@v3
- name: Test On Runner
env:
AWS_CLI_VERSION: "${{ matrix.AWS_CLI_VERSION}}"
AWS_CLI_ARCH: "${{ matrix.AWS_CLI_ARCH }}"
run: |
sudo --preserve-env ./entrypoint.sh
test_arm64:
# Supports only v2+
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- TEST_NAME: "Latest v2"
AWS_CLI_VERSION: "2"
- TEST_NAME: "Specific v2"
AWS_CLI_VERSION: "2.0.30"
name: Test arm64 ${{ matrix.TEST_NAME }} ${{ matrix.AWS_CLI_VERSION}}
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
install: true
- name: Prepare
id: prep
run: |
IMAGE="install-aws-cli"
TAG=$(echo $GITHUB_SHA | head -c7)-${{ matrix.AWS_CLI_VERSION }}
echo "tagged_image=${IMAGE}:${TAG}" >> ${GITHUB_OUTPUT}
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.AWS_CLI_VERSION }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.AWS_CLI_VERSION }}-
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
push: false
load: true
tags: ${{ steps.prep.outputs.tagged_image }}
cache-from: type=local,src=/tmp/.buildx-cache
platforms: arm64
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- name: Test In Docker
env:
AWS_CLI_VERSION: "${{ matrix.AWS_CLI_VERSION}}"
AWS_CLI_ARCH: "arm64"
DOCKER_TAG: "install-aws-cli-action"
run: |
docker run --rm -e AWS_CLI_VERSION -e AWS_CLI_ARCH "${{ steps.prep.outputs.tagged_image }}"
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache