added bindir and installdir as arguments #189
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: 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" | |
BINDIR: "/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 }}" | |
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 |