diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 68ccdc8b..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,92 +0,0 @@ -version: 2 - -jobs: - test_dashboard_server: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - command: ./test.sh dashboard-server --is-ci - test_dean: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - command: ./test.sh dean --is-ci - test_dinersclub: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - command: ./test.sh dinersclub --is-ci - test_formcentral: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - command: ./test.sh formcentral --is-ci - test_linksniffer: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - command: ./test.sh linksniffer --is-ci - test_replybot: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - command: ./test.sh replybot --is-ci - test_scribble: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - command: ./test.sh scribble --is-ci - test_e2e: - machine: - image: ubuntu-1604:202007-01 - steps: - - checkout - - run: - name: Install Kubectl/Helm - command: | - curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl - chmod +x ./kubectl - sudo mv ./kubectl /usr/local/bin/kubectl - curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash - kubectl version --client - helm version - - run: - name: Install kind - command: | - GO111MODULE="on" go get sigs.k8s.io/kind@v0.8.1 - - run: - name: Setup kind cluster - command: | - kind create cluster --name test --wait 5m - kubectl config use-context kind-test - - run: - name: Run tests - command: cd devops && ./integration-test.sh - -workflows: - version: 2 - test: - jobs: - - test_dashboard_server - - test_dean - - test_dinersclub - - test_formcentral - - test_linksniffer - - test_replybot - - test_scribble - - test_e2e: - context: secrets diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..0f3c2edd --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,68 @@ +name: test +on: + push: + branches: + - main +jobs: + test_dashboard_server: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh dashboard-server --is-ci + test_dean: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh dean --is-ci + test_dinersclub: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh dinersclub --is-ci + test_formcentral: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh formcentral --is-ci + test_linksniffer: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh linksniffer --is-ci + test_replybot: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh replybot --is-ci + test_scribble: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh scribble --is-ci + test_e2e: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install Kubectl/Helm + run: | + curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl + chmod +x ./kubectl + sudo mv ./kubectl /usr/local/bin/kubectl + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + kubectl version --client + helm version + - name: Install kind + run: GO111MODULE="on" go get sigs.k8s.io/kind@v0.8.1 + - name: Setup kind cluster + run: | + kind create cluster --name test --wait 5m + kubectl config use-context kind-test + - name: Run tests + run: cd devops && ./integration-test.sh diff --git a/.github/workflows/test_build_push.yaml b/.github/workflows/test_build_push.yaml new file mode 100644 index 00000000..6d68bf87 --- /dev/null +++ b/.github/workflows/test_build_push.yaml @@ -0,0 +1,136 @@ +name: test +on: + push: + branches: + - '**' + - '!main' +env: + REGISTRY_URL: ghcr.io/${{ github.repository }} + REGISTRY_USERNAME: ${{ github.actor }} + REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} +jobs: + test_dashboard_server: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh dashboard-server --is-ci + build_and_push_dashboard_server: + needs: + - test_dashboard_server + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Build and push container image + run: ./build_and_push.sh dashboard-server + + test_dean: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh dean --is-ci + build_and_push_dean: + needs: + - test_dean + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Build and push container image + run: ./build_and_push.sh dean + + test_dinersclub: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh dinersclub --is-ci + build_and_push_dinersclub: + needs: + - test_dinersclub + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Build and push container image + run: ./build_and_push.sh dinersclub + + test_formcentral: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh formcentral --is-ci + build_and_push_formcentral: + needs: + - test_formcentral + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Build and push container image + run: ./build_and_push.sh formcentral + + test_linksniffer: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh linksniffer --is-ci + build_and_push_linksniffer: + needs: + - test_linksniffer + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Build and push container image + run: ./build_and_push.sh linksniffer + + test_replybot: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh replybot --is-ci + build_and_push_replybot: + needs: + - test_replybot + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Build and push container image + run: ./build_and_push.sh replybot + + test_scribble: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: ./test.sh scribble --is-ci + build_and_push_scribble: + needs: + - test_scribble + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Build and push container image + run: ./build_and_push.sh scribble + + test_e2e: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install Kubectl/Helm + run: | + curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl + chmod +x ./kubectl + sudo mv ./kubectl /usr/local/bin/kubectl + curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash + kubectl version --client + helm version + - name: Install kind + run: GO111MODULE="on" go get sigs.k8s.io/kind@v0.8.1 + - name: Setup kind cluster + run: | + kind create cluster --name test --wait 5m + kubectl config use-context kind-test + - name: Run tests + run: cd devops && ./integration-test.sh diff --git a/build_and_push.sh b/build_and_push.sh new file mode 100755 index 00000000..22fad4a7 --- /dev/null +++ b/build_and_push.sh @@ -0,0 +1,5 @@ +APP_NAME=${1} +cd $APP_NAME +echo $REGISTRY_PASSWORD | docker login ghcr.io -u $REGISTRY_USERNAME --password-stdin +docker build -t $REGISTRY_URL/$APP_NAME . +docker push $REGISTRY_URL/$APP_NAME