Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d82884e

Browse files
committedDec 11, 2020
feat: move upstream tests from travisCI
1 parent 2e9bb75 commit d82884e

File tree

5 files changed

+65
-95
lines changed

5 files changed

+65
-95
lines changed
 

‎.github/workflows/test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
pull_request:
7+
paths:
8+
- '**'
9+
- '!doc/**'
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run: make build
16+
unit:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
- run: make unit
21+
- run: sed -i'' "s:^github.com/$GITHUB_REPOSITORY/::" coverage.out
22+
- uses: codecov/codecov-action@v1
23+
with:
24+
file: coverage.out
25+
fail_ci_if_error: false
26+
e2e-minikube:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v2
30+
- run: |
31+
sudo apt-get -y install conntrack
32+
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')"
33+
chmod +x minikube
34+
sudo mv minikube /bin/
35+
minikube config set vm-driver none
36+
sudo minikube start # needs root for none driver
37+
sudo chown -R "$USER" "$HOME/.kube" "$HOME/.minikube"
38+
sudo usermod -aG docker "$USER"
39+
eval $(minikube docker-env)
40+
- run: |
41+
KUBECONFIG="$HOME/.kube/config" make build e2e
42+
e2e-kind:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v2
46+
- run: |
47+
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')"
48+
chmod +x kind
49+
sudo mv kind /bin/
50+
- run: |
51+
kind create cluster
52+
kind export kubeconfig
53+
sudo chown -R "$USER" "$HOME/.kube"
54+
sudo usermod -aG docker "$USER"
55+
- run: |
56+
KUBECONFIG="$HOME/.kube/config" make build e2e

‎.github/workflows/unit.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎.travis.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

‎docs/contributors/releases.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## opm
44

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

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

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

1314
## Checking the build
1415

15-
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.
16+
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.
1617

1718
## Docker images
1819

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

2526
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.
2627

27-
28-
## Generating Travis API keys
29-
30-
This requires the travis CLI tool to be installed.
31-
32-
First, backup the existing deploy config in `.travis.yml` - the prompts will overwrite some of the config, and
33-
we only need the generated api token. This can be done by renaming the `deploy` yaml key to something else.
34-
35-
```sh
36-
$ travis setup releases -r operator-framework/operator-registry --force --pro
37-
```
38-
39-
When prompted, enter credentials for the of-deploy-robot account. Copy the api key from the newly generated `deploy` section in .travis.yml, place
40-
it in the right place in the actual deploy config, and delete the generated deploy section.
41-
42-
You mean need to `travis login --pro` first.

‎test/e2e/bundle_image_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package e2e_test
33
import (
44
"context"
55
"fmt"
6+
"io"
67
"os"
78
"os/exec"
89
"time"
@@ -677,8 +678,10 @@ spec:
677678
}
678679
}
679680

680-
func buildContainer(tag, dockerfilePath, dockerContext string) {
681+
func buildContainer(tag, dockerfilePath, dockerContext string, w io.Writer) {
681682
cmd := exec.Command(builderCmd, "build", "-t", tag, "-f", dockerfilePath, dockerContext)
683+
cmd.Stderr = w
684+
cmd.Stdout = w
682685
err := cmd.Run()
683686
Expect(err).NotTo(HaveOccurred())
684687
}
@@ -748,8 +751,8 @@ var _ = Describe("Launch bundle", func() {
748751
Expect(err).NotTo(HaveOccurred())
749752

750753
By("building required images")
751-
buildContainer(initImage, imageDirectory+"serve.Dockerfile", "../../bin")
752-
buildContainer(bundleImage, imageDirectory+"bundle.Dockerfile", imageDirectory)
754+
buildContainer(initImage, imageDirectory+"serve.Dockerfile", "../../bin", GinkgoWriter)
755+
buildContainer(bundleImage, imageDirectory+"bundle.Dockerfile", imageDirectory, GinkgoWriter)
753756

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

0 commit comments

Comments
 (0)
Please sign in to comment.