Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

docs: fix RTD build error (#648) #905

docs: fix RTD build error (#648)

docs: fix RTD build error (#648) #905

Workflow file for this run

name: Integration tests
on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
jobs:
build-docker:
name: Ensure Docker image builds
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker image
run: |
DOCKER_PUSH=false make image
check-go:
name: Ensure Go modules synchronicity
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- name: Download all Go modules
run: |
go mod download
- name: Check for tidyness of go.mod and go.sum
run: |
go mod tidy
git diff --exit-code -- .
check-manifests:
name: Verify generated manifests (ensures that all manifest changes are checked in)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- name: Regenerate the manifests, git diff should report no changes.
run: |
make manifests
git diff --exit-code -- .
build-go:
name: Build & cache Go code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- name: Restore go build cache
uses: actions/cache@v1
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
- name: Download all Go modules
run: |
go mod download
- name: Compile all packages
run: make build
lint-go:
name: Lint Go code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
test-go:
name: Run unit tests for Go packages
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
runs-on: ubuntu-latest
needs:
- build-go
steps:
- name: Create checkout directory
run: mkdir -p ~/go/src/github.com/argoproj
- name: Checkout code
uses: actions/checkout@v2
- name: Create symlink in GOPATH
run: ln -s $(pwd) ~/go/src/github.com/argoproj
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- name: Install required packages
run: |
sudo apt-get install git -y
- name: Switch to temporal branch so we re-attach head
run: |
git switch -c temporal-pr-branch
git status
- name: Fetch complete history for blame information
run: |
git fetch --prune --no-tags --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Add ~/go/bin to PATH
run: |
echo "/home/runner/go/bin" >> $GITHUB_PATH
- name: Add /usr/local/bin to PATH
run: |
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Restore go build cache
uses: actions/cache@v1
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
- name: Setup git username and email
run: |
git config --global user.name "John Doe"
git config --global user.email "john.doe@example.com"
- name: Download and vendor all required packages
run: |
go mod download
- name: Run all unit tests
run: make test
- name: Generate code coverage artifacts
uses: actions/upload-artifact@v2
with:
name: code-coverage
path: coverage.out
- name: Generate test results artifacts
uses: actions/upload-artifact@v2
with:
name: test-results
path: test-results/
test-e2e:
name: Run end-to-end tests
runs-on: ubuntu-latest
strategy:
matrix:
k3s-version: [v1.20.2, v1.16.15]
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GOPATH: /home/runner/go
ARGOCD_FAKE_IN_CLUSTER: 'true'
ARGOCD_SSH_DATA_PATH: '/tmp/argo-e2e/app/config/ssh'
ARGOCD_TLS_DATA_PATH: '/tmp/argo-e2e/app/config/tls'
ARGOCD_E2E_SSH_KNOWN_HOSTS: '../fixture/certs/ssh_known_hosts'
ARGOCD_E2E_K3S: 'true'
ARGOCD_IN_CI: 'true'
ARGOCD_E2E_APISERVER_PORT: '8088'
ARGOCD_SERVER: '127.0.0.1:8088'
steps:
- name: Checkout latest Argo CD code
uses: actions/checkout@v2
with:
repository: argoproj/argo-cd
path: argo-cd
# Pin a specific commit to prevent Argo CD regressions from impacting us:
# This version is verified to match a version consistent with the kustomize install yaml,
# by 'hack/verify-argo-cd-versions.sh'.
# BEGIN-ARGO-CD-VERSION
ref: v2.3.0
# END-ARGO-CD-VERSION
- name: Setup Golang
uses: actions/setup-go@v2
with:
go-version: '1.17.6'
- name: Restore go build cache
uses: actions/cache@v1
with:
path: ~/.cache/go-build
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
- name: Checkout latest applicationset code
uses: actions/checkout@v2
with:
path: applicationset
- name: Run E2E test setup
timeout-minutes: 20
env:
INSTALL_K3S_VERSION: ${{ matrix.k3s-version }}+k3s1
run: |
cd "$GITHUB_WORKSPACE/applicationset"
"hack/ci-e2e-setup.sh"
- name: Run E2E tests
timeout-minutes: 20
run: |
cd "$GITHUB_WORKSPACE/applicationset"
"hack/ci-e2e-run.sh"
- name: Upload e2e-server logs
uses: actions/upload-artifact@v2
with:
name: appset-e2e-server-k8s${{ matrix.k3s-version }}.log
path: /tmp/appset-e2e-server.log
if: ${{ failure() }}
- name: Upload other Argo CD server log
uses: actions/upload-artifact@v2
with:
name: argocd-e2e-server-k8s${{ matrix.k3s-version }}.log
path: /tmp/e2e-server.log
if: ${{ failure() }}