From 1e95fa3f7495ed63ddcc63f94fcc85d138a67ccc Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Fri, 23 Oct 2020 22:01:22 -0400 Subject: [PATCH 1/9] initial commit --- .github/workflows/ci.yaml | 165 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000000..5cc3863df99 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,165 @@ +name: CI +on: + pull_request: {} + push: + branches: + - master + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +jobs: + ## + ## Stage 1 + ## + test-sanity: + name: sanity + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + id: go + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: make test-sanity + + test-links: + name: doc links + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: recursive + - run: make test-links + + ## + ## Stage 2 + ## + ansible: + needs: [test-sanity, test-links] + name: ansible e2e + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - run: | + sudo apt-get install python3 python3-pip + pip3 install --upgrade setuptools pip + pip install --user ansible~=2.9.13 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: make test-e2e-ansible test-e2e-ansible-molecule + + integration: + needs: [ test-sanity, test-links ] + name: subcommand and integration + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: make test-e2e-integration + + go: + needs: [test-sanity, test-links] + name: go unit and e2e + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: make test-unit test-e2e-go + - uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: coverage.out + + helm: + needs: [test-sanity, test-links] + name: helm e2e + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: make test-e2e-helm + +# deploy-helm: +# name: deploy / helm-operator +# if: github.event_name == 'push' +# runs-on: ubuntu-latest +# needs: +# - sanity-checks +# - unit-tests +# - marker-test +# - go +# - subcommands +# - helm +# - ansible +# - ansible-molecule +# steps: +# - name: Set up Go 1.13 +# uses: actions/setup-go@v1 +# with: +# go-version: 1.13 +# id: go +# - name: Check out code into the Go module directory +# uses: actions/checkout@v1 +# - name: Build SDK binary +# run: make install +# - name: Build helm-operator base image +# run: | +# export PATH=$(go env GOPATH)/bin:$PATH +# make image-build-helm +# - name: Push helm-operator base image +# run: make image-push-helm +# env: # Or as an environment variable +# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} +# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} +# HELM_IMAGE: ${{ secrets.HELM_IMAGE }} +# +# deploy-ansible: +# name: deploy / ansible-operator +# if: github.event_name == 'push' +# runs-on: ubuntu-latest +# needs: +# - sanity-checks +# - unit-tests +# - marker-test +# - go +# - subcommands +# - helm +# - ansible +# - ansible-molecule +# steps: +# - name: Set up Go 1.13 +# uses: actions/setup-go@v1 +# with: +# go-version: 1.13 +# id: go +# - name: Check out code into the Go module directory +# uses: actions/checkout@v1 +# - name: Build SDK binary +# run: make install +# - name: Build ansible-operator base image +# run: | +# export PATH=$(go env GOPATH)/bin:$PATH +# make image-build-ansible +# - name: Push ansible-operator base image +# run: make image-push-ansible +# env: # Or as an environment variable +# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} +# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} +# ANSIBLE_IMAGE: ${{ secrets.ANSIBLE_IMAGE }} From a7eadc60d15ad4241ceed45acb8e8695c5d0e8b7 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Sat, 24 Oct 2020 21:33:38 -0400 Subject: [PATCH 2/9] set PATH for pip-installed deps --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5cc3863df99..d7805583dd5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,7 +52,9 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - run: make test-e2e-ansible test-e2e-ansible-molecule + - run: | + export PATH=/opt/python/3.6.7/bin:${PATH} + make test-e2e-ansible test-e2e-ansible-molecule integration: needs: [ test-sanity, test-links ] From b1b72e4346f0b5f908fee2266fb63165d274cf79 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Sun, 25 Oct 2020 21:16:00 -0400 Subject: [PATCH 3/9] fix molecule PATH --- .github/workflows/ci.yaml | 1 - hack/tests/e2e-ansible-molecule.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d7805583dd5..78f72f2fe70 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,7 +53,6 @@ jobs: with: fetch-depth: 0 - run: | - export PATH=/opt/python/3.6.7/bin:${PATH} make test-e2e-ansible test-e2e-ansible-molecule integration: diff --git a/hack/tests/e2e-ansible-molecule.sh b/hack/tests/e2e-ansible-molecule.sh index a2449fe734e..a4dbbda3e2c 100755 --- a/hack/tests/e2e-ansible-molecule.sh +++ b/hack/tests/e2e-ansible-molecule.sh @@ -10,6 +10,7 @@ header_text "Running tests to check ansible molecule" ROOTDIR="$(pwd)" TMPDIR="$(mktemp -d)" trap_add 'rm -rf $TMPDIR' EXIT +export PATH=${HOME}/.local/bin:${PATH} pip3 install --user pyasn1==0.4.7 pyasn1-modules==0.2.6 idna==2.8 ipaddress==1.0.22 pip3 install --user molecule==3.0.2 pip3 install --user ansible-lint yamllint From e60b22c9bca688a4262ee7de7864f6c8632c5d24 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Tue, 24 Nov 2020 11:42:27 -0500 Subject: [PATCH 4/9] remove commented out deploy steps --- .github/workflows/ci.yaml | 68 --------------------------------------- 1 file changed, 68 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 78f72f2fe70..e4878f46b19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -96,71 +96,3 @@ jobs: with: fetch-depth: 0 - run: make test-e2e-helm - -# deploy-helm: -# name: deploy / helm-operator -# if: github.event_name == 'push' -# runs-on: ubuntu-latest -# needs: -# - sanity-checks -# - unit-tests -# - marker-test -# - go -# - subcommands -# - helm -# - ansible -# - ansible-molecule -# steps: -# - name: Set up Go 1.13 -# uses: actions/setup-go@v1 -# with: -# go-version: 1.13 -# id: go -# - name: Check out code into the Go module directory -# uses: actions/checkout@v1 -# - name: Build SDK binary -# run: make install -# - name: Build helm-operator base image -# run: | -# export PATH=$(go env GOPATH)/bin:$PATH -# make image-build-helm -# - name: Push helm-operator base image -# run: make image-push-helm -# env: # Or as an environment variable -# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} -# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} -# HELM_IMAGE: ${{ secrets.HELM_IMAGE }} -# -# deploy-ansible: -# name: deploy / ansible-operator -# if: github.event_name == 'push' -# runs-on: ubuntu-latest -# needs: -# - sanity-checks -# - unit-tests -# - marker-test -# - go -# - subcommands -# - helm -# - ansible -# - ansible-molecule -# steps: -# - name: Set up Go 1.13 -# uses: actions/setup-go@v1 -# with: -# go-version: 1.13 -# id: go -# - name: Check out code into the Go module directory -# uses: actions/checkout@v1 -# - name: Build SDK binary -# run: make install -# - name: Build ansible-operator base image -# run: | -# export PATH=$(go env GOPATH)/bin:$PATH -# make image-build-ansible -# - name: Push ansible-operator base image -# run: make image-push-ansible -# env: # Or as an environment variable -# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} -# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} -# ANSIBLE_IMAGE: ${{ secrets.ANSIBLE_IMAGE }} From 3139ad569f0f724c8808a9f22400bdf5cc7abc02 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Tue, 24 Nov 2020 13:13:00 -0500 Subject: [PATCH 5/9] remove environment's installed kustomize --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4878f46b19..804fde7f628 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,6 +22,7 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize - run: make test-sanity test-links: @@ -52,6 +53,7 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize - run: | make test-e2e-ansible test-e2e-ansible-molecule @@ -79,6 +81,7 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize - run: make test-unit test-e2e-go - uses: shogo82148/actions-goveralls@v1 with: @@ -95,4 +98,5 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize - run: make test-e2e-helm From 8f841929ed9426095b6502c2bd1c27ac5b80c641 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Tue, 24 Nov 2020 14:07:58 -0500 Subject: [PATCH 6/9] Only run workflow on PRs --- .github/workflows/ci.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 804fde7f628..568d043e11d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,11 +1,6 @@ name: CI on: pull_request: {} - push: - branches: - - master - tags: - - v[0-9]+.[0-9]+.[0-9]+ jobs: ## From f6de3d570ef808fbeb854b71e3f2d99ca1248415 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Tue, 24 Nov 2020 15:29:30 -0500 Subject: [PATCH 7/9] split jobs into separate workflows so they can be re-run individually --- .github/workflows/ci.yaml | 97 ------------------------------ .github/workflows/integration.yml | 16 +++++ .github/workflows/test-ansible.yml | 38 ++++++++++++ .github/workflows/test-go.yml | 32 ++++++++++ .github/workflows/test-helm.yml | 17 ++++++ .github/workflows/test-sanity.yml | 28 +++++++++ 6 files changed, 131 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/integration.yml create mode 100644 .github/workflows/test-ansible.yml create mode 100644 .github/workflows/test-go.yml create mode 100644 .github/workflows/test-helm.yml create mode 100644 .github/workflows/test-sanity.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 568d043e11d..00000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,97 +0,0 @@ -name: CI -on: - pull_request: {} - -jobs: - ## - ## Stage 1 - ## - test-sanity: - name: sanity - runs-on: ubuntu-18.04 - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.15 - id: go - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - run: sudo rm -rf /usr/local/bin/kustomize - - run: make test-sanity - - test-links: - name: doc links - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - submodules: recursive - - run: make test-links - - ## - ## Stage 2 - ## - ansible: - needs: [test-sanity, test-links] - name: ansible e2e - runs-on: ubuntu-18.04 - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.15 - - run: | - sudo apt-get install python3 python3-pip - pip3 install --upgrade setuptools pip - pip install --user ansible~=2.9.13 - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - run: sudo rm -rf /usr/local/bin/kustomize - - run: | - make test-e2e-ansible test-e2e-ansible-molecule - - integration: - needs: [ test-sanity, test-links ] - name: subcommand and integration - runs-on: ubuntu-18.04 - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.15 - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - run: make test-e2e-integration - - go: - needs: [test-sanity, test-links] - name: go unit and e2e - runs-on: ubuntu-18.04 - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.15 - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - run: sudo rm -rf /usr/local/bin/kustomize - - run: make test-unit test-e2e-go - - uses: shogo82148/actions-goveralls@v1 - with: - path-to-profile: coverage.out - - helm: - needs: [test-sanity, test-links] - name: helm e2e - runs-on: ubuntu-18.04 - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.15 - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - run: sudo rm -rf /usr/local/bin/kustomize - - run: make test-e2e-helm diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 00000000000..1e216c12574 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,16 @@ +name: integration +on: + pull_request: {} + +jobs: + integration: + name: integration + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: make test-e2e-integration diff --git a/.github/workflows/test-ansible.yml b/.github/workflows/test-ansible.yml new file mode 100644 index 00000000000..b8f23c7e200 --- /dev/null +++ b/.github/workflows/test-ansible.yml @@ -0,0 +1,38 @@ +name: ansible +on: + pull_request: {} + +jobs: + e2e: + name: e2e + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - run: | + sudo apt-get install python3 python3-pip + pip3 install --upgrade setuptools pip + pip install --user ansible~=2.9.13 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize + - run: make test-e2e-ansible + + e2e-molecule: + name: e2e-molecule + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - run: | + sudo apt-get install python3 python3-pip + pip3 install --upgrade setuptools pip + pip install --user ansible~=2.9.13 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize + - run: make test-e2e-ansible-molecule diff --git a/.github/workflows/test-go.yml b/.github/workflows/test-go.yml new file mode 100644 index 00000000000..9423fa0579f --- /dev/null +++ b/.github/workflows/test-go.yml @@ -0,0 +1,32 @@ +name: go +on: + pull_request: {} + +jobs: + e2e: + name: e2e + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize + - run: make test-e2e-go + + unit: + name: unit + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: make test-unit + - uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: coverage.out diff --git a/.github/workflows/test-helm.yml b/.github/workflows/test-helm.yml new file mode 100644 index 00000000000..0809e4d511d --- /dev/null +++ b/.github/workflows/test-helm.yml @@ -0,0 +1,17 @@ +name: helm +on: + pull_request: {} + +jobs: + e2e: + name: e2e + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize + - run: make test-e2e-helm diff --git a/.github/workflows/test-sanity.yml b/.github/workflows/test-sanity.yml new file mode 100644 index 00000000000..bb194f97468 --- /dev/null +++ b/.github/workflows/test-sanity.yml @@ -0,0 +1,28 @@ +name: sanity +on: + pull_request: {} + +jobs: + sanity: + name: sanity + runs-on: ubuntu-18.04 + steps: + - uses: actions/setup-go@v2 + with: + go-version: 1.15 + id: go + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - run: sudo rm -rf /usr/local/bin/kustomize + - run: make test-sanity + + links: + name: doc links + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: recursive + - run: make test-links From 6c3d9b036610785262b1b6201f2513c8279b6b09 Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Tue, 24 Nov 2020 16:11:34 -0500 Subject: [PATCH 8/9] trying to fix e2e-molecule test --- .github/workflows/test-ansible.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-ansible.yml b/.github/workflows/test-ansible.yml index b8f23c7e200..940f49f485d 100644 --- a/.github/workflows/test-ansible.yml +++ b/.github/workflows/test-ansible.yml @@ -10,10 +10,6 @@ jobs: - uses: actions/setup-go@v2 with: go-version: 1.15 - - run: | - sudo apt-get install python3 python3-pip - pip3 install --upgrade setuptools pip - pip install --user ansible~=2.9.13 - uses: actions/checkout@v2 with: fetch-depth: 0 @@ -27,12 +23,15 @@ jobs: - uses: actions/setup-go@v2 with: go-version: 1.15 - - run: | - sudo apt-get install python3 python3-pip - pip3 install --upgrade setuptools pip - pip install --user ansible~=2.9.13 - uses: actions/checkout@v2 with: fetch-depth: 0 - run: sudo rm -rf /usr/local/bin/kustomize - - run: make test-e2e-ansible-molecule + - run: | + env + export PATH=/opt/python/3.6.7/bin:${PATH} + sudo apt-get install python3 python3-pip + pip3 install wheel + pip3 install --upgrade setuptools pip + pip install --user ansible~=2.9.13 + make test-e2e-ansible-molecule From c5d127307708a7c5783402082e366de2134dd52a Mon Sep 17 00:00:00 2001 From: Eric Stroczynski Date: Tue, 24 Nov 2020 14:07:38 -0800 Subject: [PATCH 9/9] try pip3 install --- .github/workflows/test-ansible.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-ansible.yml b/.github/workflows/test-ansible.yml index 940f49f485d..0eb41f7af64 100644 --- a/.github/workflows/test-ansible.yml +++ b/.github/workflows/test-ansible.yml @@ -31,7 +31,7 @@ jobs: env export PATH=/opt/python/3.6.7/bin:${PATH} sudo apt-get install python3 python3-pip - pip3 install wheel - pip3 install --upgrade setuptools pip - pip install --user ansible~=2.9.13 + sudo pip3 install wheel + sudo pip3 install --upgrade setuptools pip + sudo pip3 install ansible~=2.9.13 make test-e2e-ansible-molecule