name: Integration test for setup-kubectl-v1 on: # rebuild any PRs and main branch changes pull_request: branches: - main - 'releases/*' push: branches: - main - 'releases/*' 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' - 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'