79 lines
2.5 KiB
YAML
79 lines
2.5 KiB
YAML
name: Integration test for setup-kubectl-v1
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
reason:
|
|
description: 'Reason for run'
|
|
required: true
|
|
repository_dispatch:
|
|
types: "SetupKubectlActionPR"
|
|
|
|
jobs:
|
|
run-integration-test:
|
|
name: Validate release and master branch
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Set job type
|
|
id: job-type
|
|
run: if [ '${{ github.event.inputs.reason }}' == 'cron' ]; then echo "::set-output name=type::$(echo cron)"; else echo "::set-output name=type::$(echo pr)"; fi
|
|
shell: bash
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-ruby@v1
|
|
if: steps.job-type.outputs.type == 'pr'
|
|
name: Install ruby
|
|
with:
|
|
ruby-version: '2.7'
|
|
|
|
- name: Marking status as in-progress on PR
|
|
if: steps.job-type.outputs.type == 'pr'
|
|
run: |
|
|
ruby postStatus.rb ${{github.event.client_payload.repository}} ${{github.event.client_payload.commit}} ${{secrets.L2_REPO_TOKEN}} ${{job.status}} ${{github.run_id}} ${{matrix.os}} true ${{ secrets.L2_REPO_USER }}
|
|
- uses: actions/checkout@v2
|
|
if: steps.job-type.outputs.type == 'pr'
|
|
name: Checkout from PR branch
|
|
with:
|
|
repository: Azure/setup-kubectl
|
|
ref: ${{ github.event.client_payload.frombranch }}
|
|
path: 'setup-kubectl'
|
|
|
|
- uses: actions/checkout@v2
|
|
if: steps.job-type.outputs.type == 'cron'
|
|
name: Checkout from main branch
|
|
with:
|
|
repository: Azure/setup-kubectl
|
|
path: 'setup-kubectl'
|
|
|
|
- uses: actions/setup-python@v2
|
|
name: Install Python
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install requests library
|
|
run: pip install requests
|
|
|
|
- name: Building latest changes
|
|
if: steps.job-type.outputs.type == 'cron' || (steps.job-type.outputs.type == 'pr' && github.event.client_payload.tobranch == 'main')
|
|
run: |
|
|
cd setup-kubectl
|
|
npm install
|
|
npm run build
|
|
- name: Setup kubectl
|
|
uses: ./setup-kubectl
|
|
with:
|
|
version: latest
|
|
|
|
- name: Validate kubectl setup
|
|
run: python test/validate-kubectl.py latest
|
|
|
|
- name: Setup kubectl
|
|
uses: ./setup-kubectl
|
|
with:
|
|
version: 'v1.15.1'
|
|
|
|
- name: Validate kubectl setup
|
|
run: python test/validate-kubectl.py 'v1.15.1'
|