Skip to content

Commit

Permalink
feat: move upstream tests from travisCI
Browse files Browse the repository at this point in the history
  • Loading branch information
exdx committed Dec 11, 2020
1 parent 2e9bb75 commit 5096e9a
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 95 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/unit.yaml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/upstreams-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: upstream-tests
on:
push:
branches:
- '**'
pull_request:
paths:
- '**'
- '!doc/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make build
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: make unit
- run: sed -i'' "s:^github.com/$GITHUB_REPOSITORY/::" coverage.out
- uses: codecov/codecov-action@v1
with:
file: coverage.out
fail_ci_if_error: false
run-e2e-minikube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
sudo apt-get -y install conntrack
curl -sLo minikube "$(curl -sL https://api.github.com/repos/kubernetes/minikube/releases/latest | jq -r '[.assets[] | select(.name == "minikube-linux-amd64")] | first | .browser_download_url')"
chmod +x minikube
sudo mv minikube /bin/
minikube config set vm-driver none
sudo minikube start # needs root for none driver
sudo chown -R "$USER" "$HOME/.kube" "$HOME/.minikube"
sudo usermod -aG docker "$USER"
eval $(minikube docker-env)
- run: |
KUBECONFIG="$HOME/.kube/config" make build e2e
run-e2e-kind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
curl -sLo kind "$(curl -sL https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '[.assets[] | select(.name == "kind-linux-amd64")] | first | .browser_download_url')"
chmod +x kind
sudo mv kind /bin/
- run: |
kind create cluster
kind export kubeconfig
sudo chown -R "$USER" "$HOME/.kube"
sudo usermod -aG docker "$USER"
- run: |
KUBECONFIG="$HOME/.kube/config" make build e2e
57 changes: 0 additions & 57 deletions .travis.yml

This file was deleted.

21 changes: 3 additions & 18 deletions docs/contributors/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## opm

Releases of opm are built by travis, see the [travis.yml](../../.travis.yml) for details.
Releases of opm are built by Github Actions, see the [release.yml](../../.github/workflows/release.yml) for details.
amd64 builds are produced for linux, macos, and windows.

opm follows semantic versioning, with the latest version derived from the newest semver tag.

Expand All @@ -12,7 +13,7 @@ Releases are triggered via tags. Make a new release by tagging a commit with an

## Checking the build

Builds for a release can be found [on travis](https://travis-ci.com/operator-framework/operator-registry). After triggering a build, watch for logs. If the build is successful, a new [release](https://github.com/operator-framework/operator-registry) should appear in GitHub.
Builds for a release can be found [on GitHub Actions](https://github.com/operator-framework/operator-registry/actions). After triggering a build, watch for logs. If the build is successful, a new [release](https://github.com/operator-framework/operator-registry/releases) should appear in GitHub.

## Docker images

Expand All @@ -24,19 +25,3 @@ Builds are also triggered for the following docker images. The tags in Quay.io w

Images are also built to track master with `latest` tags. It is recommended that you always pull by digest, and only use images that are tagged with a version.


## Generating Travis API keys

This requires the travis CLI tool to be installed.

First, backup the existing deploy config in `.travis.yml` - the prompts will overwrite some of the config, and
we only need the generated api token. This can be done by renaming the `deploy` yaml key to something else.

```sh
$ travis setup releases -r operator-framework/operator-registry --force --pro
```

When prompted, enter credentials for the of-deploy-robot account. Copy the api key from the newly generated `deploy` section in .travis.yml, place
it in the right place in the actual deploy config, and delete the generated deploy section.

You mean need to `travis login --pro` first.
9 changes: 6 additions & 3 deletions test/e2e/bundle_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package e2e_test
import (
"context"
"fmt"
"io"
"os"
"os/exec"
"time"
Expand Down Expand Up @@ -677,8 +678,10 @@ spec:
}
}

func buildContainer(tag, dockerfilePath, dockerContext string) {
func buildContainer(tag, dockerfilePath, dockerContext string, w io.Writer) {
cmd := exec.Command(builderCmd, "build", "-t", tag, "-f", dockerfilePath, dockerContext)
cmd.Stderr = w
cmd.Stdout = w
err := cmd.Run()
Expect(err).NotTo(HaveOccurred())
}
Expand Down Expand Up @@ -748,8 +751,8 @@ var _ = Describe("Launch bundle", func() {
Expect(err).NotTo(HaveOccurred())

By("building required images")
buildContainer(initImage, imageDirectory+"serve.Dockerfile", "../../bin")
buildContainer(bundleImage, imageDirectory+"bundle.Dockerfile", imageDirectory)
buildContainer(initImage, imageDirectory+"serve.Dockerfile", "../../bin", GinkgoWriter)
buildContainer(bundleImage, imageDirectory+"bundle.Dockerfile", imageDirectory, GinkgoWriter)

By("creating a batch job")
bundleDataConfigMap, job, err := configmap.LaunchBundleImage(kubeclient, bundleImage, initImage, namespace)
Expand Down

0 comments on commit 5096e9a

Please sign in to comment.