diff --git a/.github/workflows/test-e2e-desktop.yaml b/.github/workflows/test-e2e-desktop.yaml new file mode 100644 index 0000000000..9b8a2b1228 --- /dev/null +++ b/.github/workflows/test-e2e-desktop.yaml @@ -0,0 +1,125 @@ +name: Test E2E Desktop Client + +# run only on changes to desktop? + +on: + push: # !! test + branches: + - moduli-e2e-desktop + pull_request: + +jobs: + dependencies: + name: Install dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 + id: node-modules-cache + with: + path: '**/node_modules' + key: node-modules-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + node-modules- + + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: 20 + - run: yarn install + + test: + name: Run Desktop E2E Tests + needs: [dependencies] + runs-on: ubuntu-latest + env: + ENOS_VAR_boundary_edition: "oss" + ENOS_VAR_e2e_debug_no_run: true + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 + id: node-modules-cache + with: + path: '**/node_modules' + key: node-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Set up Terraform + uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 + + - name: Set up Enos + uses: hashicorp/action-setup-enos@b9fa53484a1e8fdcc7b02a118bcf01d65b9414c9 + + - name: Set up Node + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 + with: + node-version: 20 + + - name: Set up Go + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + with: + go-version: ${{ inputs.go-version }} + cache: false + + - name: Install Vault CLI + run: | + wget https://releases.hashicorp.com/vault/1.12.2/vault_1.12.2_linux_amd64.zip -O /tmp/vault.zip + unzip /tmp/vault.zip -d /usr/local/bin + + # # -- Get Boundary binary (!! get latest?) + # - name: Download Boundary AMD64 binary + # run: | + # wget https://releases.hashicorp.com/boundary/0.18.2/boundary_0.18.2_linux_amd64.zip -O /tmp/boundary.zip + + - name: Checkout boundary + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + repository: hashicorp/boundary + path: support/src/boundary + + # - name: Checkout boundary-enterprise + # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + # with: + # repository: hashicorp/boundary-enterprise + # ref: ${{ github.event.inputs.boundary-enterprise-branch }} + # path: support/src/boundary-enterprise + # token: ${{ env.GITHUB_TOKEN }} + + - name: GH fix for localhost resolution + # !! does this work in boundary-ui-enterprise? + if: github.repository == 'hashicorp/boundary-ui' + run: | + cat /etc/hosts && echo "-----------" + sudo sed -i 's/::1 *localhost ip6-localhost ip6-loopback/::1 ip6 -localhost ip6-loopback/g' /etc/hosts + cat /etc/hosts + ssh -V + + - name: Set up test infra + id: infra + run: | + ssh-keygen -N '' -t ed25519 -f ~/.ssh/github_enos + mkdir -p ./enos/terraform-plugin-cache + export ENOS_VAR_enos_user=$GITHUB_ACTOR && \ + export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \ + export GOOS=linux && \ + export GOARCH=amd64 && \ + export DEV_DOCKER_GOARCH=amd64 && \ + enos scenario launch --timeout 60m0s --chdir ./support/src/boundary/enos e2e_ui_docker builder:local + + - name: Run Tests + run: | + bash ./support/src/boundary/enos/scripts/test_e2e_env.sh + source <(. ./support/src/boundary/enos/scripts/test_e2e_env.sh) + cd e2e-tests + yarn run desktop + + - name: Clean up test infra + if: ${{ always() }} + run: | + export ENOS_VAR_enos_user=$GITHUB_ACTOR && \ + export ENOS_VAR_aws_ssh_private_key_path=~/.ssh/github_enos && \ + enos scenario destroy --timeout 60m0s --chdir ./support/src/boundary/enos e2e_ui_docker builder:local + + + # Log files? +