mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-03-04 02:30:23 +00:00
* Using matrix strategy for e2e on multiple k8s versions * EndpointSlice version support according to Kubernetes release * Utility helper for testing various Kubernetes versions
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: CI
|
|
|
|
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
# events but only for the master branch
|
|
on:
|
|
push:
|
|
branches: [ "*" ]
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
# This workflow contains a single job called "build"
|
|
golangci:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Run golangci-lint
|
|
uses: golangci/golangci-lint-action@v2.2.0
|
|
with:
|
|
# version of golangci-lint to use in form of v1.2.3
|
|
version: latest
|
|
# if set to true and the action runs on a pull request - the action outputs only newly found issues
|
|
only-new-issues: false
|
|
args: --timeout 2m
|
|
kind:
|
|
name: e2e
|
|
strategy:
|
|
matrix:
|
|
k8s-version: ['v1.16.15', 'v1.17.11', 'v1.18.8', 'v1.19.1']
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Cache Go modules and Docker images
|
|
uses: actions/cache@v1
|
|
env:
|
|
cache-name: gomod-docker
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
/var/lib/docker
|
|
/home/runner/work/capsule/capsule
|
|
key: ${{ matrix.k8s-version }}-build-${{ env.cache-name }}
|
|
restore-keys: |
|
|
${{ matrix.k8s-version }}-build-
|
|
${{ matrix.k8s-version }}-
|
|
- name: Removing kustomize
|
|
run: sudo snap remove kustomize && sudo rm -rf $(which kustomize)
|
|
- name: Installing Ginkgo
|
|
run: go get github.com/onsi/ginkgo/ginkgo
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '^1.13.8'
|
|
- uses: engineerd/setup-kind@v0.4.0
|
|
with:
|
|
skipClusterCreation: true
|
|
- name: e2e testing
|
|
run: make e2e/${{ matrix.k8s-version }}
|