Merge pull request #3044 from hashicorp/tmessi-ci-actionlint
This performs some final clean up of github actions as part of the migration away from CircleCI
This commit is contained in:
14 files changed
+263
-215
No files matched your search
@@ -0,0 +1,18 @@
|
||||
name: Lint GitHub Actions workflows
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".github/workflows/*.yml"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
actionlint:
|
||||
runs-on: ${{ fromJSON(vars.RUNNER) }}
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Check workflow files
|
||||
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint@sha256:02ccb6d91e4cb4a7b21eb99d5274d257e81ae667688d730e89d7ea0d6d35db91
|
||||
with:
|
||||
args: -color -ignore SC2129 -ignore "'property \"download-path\" is not defined in object type'"
|
||||
+61
-171
@@ -8,46 +8,50 @@ on:
|
||||
env:
|
||||
PKG_NAME: "boundary"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
set-product-version:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_LINUX) }}
|
||||
outputs:
|
||||
product-version: ${{ steps.set-product-version.outputs.product-version }}
|
||||
base-product-version: $${{ steps.set-product-version.outputs.base-product-version }}
|
||||
prerelease-product-version: ${{ steps.set-product-version.outputs.prerelease-product-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set Product version
|
||||
id: set-product-version
|
||||
uses: hashicorp/actions-set-product-version@v1
|
||||
uses: hashicorp/actions-set-product-version@v1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
|
||||
product-metadata:
|
||||
needs: set-product-version
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_LINUX) }}
|
||||
outputs:
|
||||
product-minor-version: ${{ steps.get-product-minor-version.outputs.product-minor-version }}
|
||||
product-edition: ${{ steps.get-product-edition.outputs.product-edition }}
|
||||
go-version: ${{ steps.get-go-version.outputs.go-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Determine Go version
|
||||
id: get-go-version
|
||||
# We use .go-version as our source of truth for current Go
|
||||
# version, because "goenv" can react to it automatically.
|
||||
run: |
|
||||
echo "Building with Go $(cat .go-version)"
|
||||
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
|
||||
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ steps.get-go-version.outputs.go-version }}"
|
||||
- name: Determine Go cache paths
|
||||
id: go-cache-paths
|
||||
run: |
|
||||
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
@@ -60,22 +64,22 @@ jobs:
|
||||
# Run make edition twice to ensure that extra go output isn't included
|
||||
run: |
|
||||
make edition
|
||||
echo "product-edition=$(make edition)" >> $GITHUB_OUTPUT
|
||||
echo "product-edition=$(make edition)" >> "$GITHUB_OUTPUT"
|
||||
- name: Determine minor product version
|
||||
id: get-product-minor-version
|
||||
run: |
|
||||
VERSION=${{ needs.set-product-version.outputs.product-version }}
|
||||
MINOR_VERSION=$(echo $VERSION | cut -d. -f-2)
|
||||
echo "product-minor-version=$MINOR_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "product-minor-version=$MINOR_VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
verify-product-metadata:
|
||||
needs:
|
||||
- set-product-version
|
||||
- product-metadata
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_LINUX) }}
|
||||
steps:
|
||||
- name: 'Checkout directory'
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- run: |
|
||||
echo "Product Version - ${{ needs.set-product-version.outputs.product-version }}"
|
||||
echo "Product Prerelease - ${{ needs.set-product-version.outputs.prerelease-product-version }}"
|
||||
@@ -84,20 +88,20 @@ jobs:
|
||||
|
||||
generate-metadata-file:
|
||||
needs: set-product-version
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_LINUX) }}
|
||||
outputs:
|
||||
filepath: ${{ steps.generate-metadata-file.outputs.filepath }}
|
||||
steps:
|
||||
- name: 'Checkout directory'
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Generate metadata file
|
||||
id: generate-metadata-file
|
||||
uses: hashicorp/actions-generate-metadata@v1
|
||||
uses: hashicorp/actions-generate-metadata@v1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
version: ${{ needs.set-product-version.outputs.product-version }}
|
||||
product: ${{ env.PKG_NAME }}
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: metadata.json
|
||||
path: ${{ steps.generate-metadata-file.outputs.filepath }}
|
||||
@@ -106,7 +110,7 @@ jobs:
|
||||
needs:
|
||||
- product-metadata
|
||||
- set-product-version
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_LINUX) }}
|
||||
strategy:
|
||||
matrix:
|
||||
goos: [ freebsd, windows, netbsd, openbsd, solaris ]
|
||||
@@ -126,18 +130,18 @@ jobs:
|
||||
GOPRIVATE: "github.com/hashicorp"
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- name: Determine Go cache paths
|
||||
id: go-cache-paths
|
||||
run: |
|
||||
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
@@ -149,9 +153,9 @@ jobs:
|
||||
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
|
||||
- name: Determine SHA
|
||||
id: set-sha
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> $GITHUB_OUTPUT
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> "$GITHUB_OUTPUT"
|
||||
- name: Download UI artifact
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2.26.0
|
||||
with:
|
||||
workflow: build-admin-ui.yaml
|
||||
commit: ${{ steps.set-sha.outputs.sha }}
|
||||
@@ -163,7 +167,7 @@ jobs:
|
||||
CGO_ENABLED: "0"
|
||||
PRERELEASE_PRODUCT_VERSION: ${{ needs.set-product-version.outputs.prerelease-product-version }}
|
||||
METADATA_PRODUCT_VERSION: ${{ needs.product-metadata.outputs.product-edition }}
|
||||
uses: hashicorp/actions-go-build@v0.1.9
|
||||
uses: hashicorp/actions-go-build@v0.1.9 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
product_name: ${{ env.PKG_NAME }}
|
||||
product_version: ${{ needs.set-product-version. outputs.product-version }}
|
||||
@@ -173,7 +177,7 @@ jobs:
|
||||
reproducible: report
|
||||
instructions: |-
|
||||
make build
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: ${{ env.PKG_NAME }}_${{ needs.set-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||
path: out/${{ env.PKG_NAME }}_${{ needs.set-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||
@@ -182,7 +186,7 @@ jobs:
|
||||
needs:
|
||||
- product-metadata
|
||||
- set-product-version
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_LINUX) }}
|
||||
strategy:
|
||||
matrix:
|
||||
goos: [linux]
|
||||
@@ -197,20 +201,20 @@ jobs:
|
||||
GO111MODULE: on
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up Git
|
||||
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- name: Determine Go cache paths
|
||||
id: go-cache-paths
|
||||
run: |
|
||||
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
@@ -220,9 +224,9 @@ jobs:
|
||||
${{ runner.os }}-go-
|
||||
- name: Determine SHA
|
||||
id: set-sha
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> $GITHUB_OUTPUT
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> "$GITHUB_OUTPUT"
|
||||
- name: Download UI artifact
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2.26.0
|
||||
with:
|
||||
workflow: build-admin-ui.yaml
|
||||
commit: ${{ steps.set-sha.outputs.sha }}
|
||||
@@ -234,7 +238,7 @@ jobs:
|
||||
CGO_ENABLED: "0"
|
||||
PRERELEASE_PRODUCT_VERSION: ${{ needs.set-product-version.outputs.prerelease-product-version }}
|
||||
METADATA_PRODUCT_VERSION: ${{ needs.product-metadata.outputs.product-edition }}
|
||||
uses: hashicorp/actions-go-build@v0.1.9
|
||||
uses: hashicorp/actions-go-build@v0.1.9 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
product_name: ${{ env.PKG_NAME }}
|
||||
product_version: ${{ needs.set-product-version. outputs.product-version }}
|
||||
@@ -244,12 +248,12 @@ jobs:
|
||||
reproducible: report
|
||||
instructions: |-
|
||||
make build
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: ${{ env.PKG_NAME }}_${{ needs.set-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||
path: out/${{ env.PKG_NAME }}_${{ needs.set-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||
- name: Package
|
||||
uses: hashicorp/actions-packaging-linux@v1
|
||||
uses: hashicorp/actions-packaging-linux@v1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
name: ${{ github.event.repository.name }}
|
||||
description: "HashiCorp Boundary - Identity-based access management for dynamic infrastructure"
|
||||
@@ -266,15 +270,15 @@ jobs:
|
||||
postremove: ".release/linux/postrm"
|
||||
- name: Add Linux Package names to env
|
||||
run: |
|
||||
echo "RPM_PACKAGE=$(basename out/*.rpm)" >> $GITHUB_ENV
|
||||
echo "DEB_PACKAGE=$(basename out/*.deb)" >> $GITHUB_ENV
|
||||
echo "RPM_PACKAGE=$(basename out/*.rpm)" >> "$GITHUB_ENV"
|
||||
echo "DEB_PACKAGE=$(basename out/*.deb)" >> "$GITHUB_ENV"
|
||||
- name: Upload RPM package
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: ${{ env.RPM_PACKAGE }}
|
||||
path: out/${{ env.RPM_PACKAGE }}
|
||||
- name: Upload DEB package
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: ${{ env.DEB_PACKAGE }}
|
||||
path: out/${{ env.DEB_PACKAGE }}
|
||||
@@ -283,7 +287,7 @@ jobs:
|
||||
needs:
|
||||
- product-metadata
|
||||
- set-product-version
|
||||
runs-on: macos-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_MACOS) }}
|
||||
strategy:
|
||||
matrix:
|
||||
goos: [ darwin ]
|
||||
@@ -297,18 +301,18 @@ jobs:
|
||||
GO111MODULE: on
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
- name: Determine Go cache paths
|
||||
id: go-cache-paths
|
||||
run: |
|
||||
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
|
||||
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
@@ -318,9 +322,9 @@ jobs:
|
||||
${{ runner.os }}-go-
|
||||
- name: Determine SHA
|
||||
id: set-sha
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> $GITHUB_OUTPUT
|
||||
run: echo "sha=$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" >> "$GITHUB_OUTPUT"
|
||||
- name: Download UI artifact
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2.26.0
|
||||
with:
|
||||
workflow: build-admin-ui.yaml
|
||||
commit: ${{ steps.set-sha.outputs.sha }}
|
||||
@@ -332,7 +336,7 @@ jobs:
|
||||
CGO_ENABLED: "0"
|
||||
PRERELEASE_PRODUCT_VERSION: ${{ needs.set-product-version.outputs.prerelease-product-version }}
|
||||
METADATA_PRODUCT_VERSION: ${{ needs.product-metadata.outputs.product-edition }}
|
||||
uses: hashicorp/actions-go-build@v0.1.9
|
||||
uses: hashicorp/actions-go-build@v0.1.9 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
product_name: ${{ env.PKG_NAME }}
|
||||
product_version: ${{ needs.set-product-version. outputs.product-version }}
|
||||
@@ -342,7 +346,7 @@ jobs:
|
||||
reproducible: report
|
||||
instructions: |-
|
||||
make build
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: ${{ env.PKG_NAME }}_${{ needs.set-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||
path: out/${{ env.PKG_NAME }}_${{ needs.set-product-version.outputs.product-version }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
|
||||
@@ -353,7 +357,7 @@ jobs:
|
||||
- product-metadata
|
||||
- set-product-version
|
||||
- build-linux
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ fromJSON(vars.BUILDER_LINUX) }}
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ["arm", "arm64", "386", "amd64"]
|
||||
@@ -364,9 +368,9 @@ jobs:
|
||||
version: ${{ needs.set-product-version.outputs.product-version }}
|
||||
minor-version: ${{ needs.product-metadata.outputs.product-minor-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Docker Build (Action)
|
||||
uses: hashicorp/actions-docker-build@v1
|
||||
uses: hashicorp/actions-docker-build@v1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
version: ${{ env.version }}
|
||||
target: default
|
||||
@@ -392,6 +396,7 @@ jobs:
|
||||
- set-product-version
|
||||
- product-metadata
|
||||
- build-linux
|
||||
- build-docker
|
||||
uses: ./.github/workflows/enos-run.yml
|
||||
with:
|
||||
artifact-name: "boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip"
|
||||
@@ -399,118 +404,3 @@ jobs:
|
||||
docker-image-name: ${{ needs.build-docker.outputs.name }}
|
||||
docker-image-file: "boundary_default_linux_amd64_${{ needs.set-product-version.outputs.product-version }}_${{ github.sha }}.docker.dev.tar"
|
||||
secrets: inherit
|
||||
|
||||
bats:
|
||||
runs-on: ubuntu-latest
|
||||
name: CLI tests
|
||||
if: "! github.event.pull_request.head.repo.fork"
|
||||
needs:
|
||||
- set-product-version
|
||||
- build-linux
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Import GPG key for Boundary pass keystore
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v5
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.ENOS_GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.ENOS_GPG_PASSPHRASE }}
|
||||
- name: Trust the pass keystore GPG key
|
||||
id: trust_gpg
|
||||
run: |
|
||||
gpg -a --encrypt -r ${{ secrets.ENOS_GPG_UID }} --trust-model always
|
||||
echo "trusted-key ${{ secrets.ENOS_GPG_UID }}" >> ~/.gnupg/gpg.conf
|
||||
cat ~/.gnupg/gpg.conf
|
||||
- name: Set up Bats CLI UI tests dependency cache
|
||||
id: dep-cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/bats-cli-ui-deps
|
||||
key: enos-bats-cli-ui-deps-jq-1.6-password-store-1.7.4-vault-1.12.2
|
||||
- name: Set up Node for Bats install
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install Bats via NPM
|
||||
# Use npm so this workflow is portable on multiple runner distros
|
||||
run: npm install --location=global bats
|
||||
- name: Download jq for Bats CLI UI tests
|
||||
if: steps.dep-cache.outputs.cache-hit != 'true'
|
||||
# NOTE: if you update the jq version make sure to update the dep cache key
|
||||
run: |
|
||||
mkdir -p /tmp/bats-cli-ui-deps
|
||||
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O /tmp/bats-cli-ui-deps/jq-bin
|
||||
- name: Install jq for Bats CLI UI tests
|
||||
run: |
|
||||
chmod +x /tmp/bats-cli-ui-deps/jq-bin
|
||||
sudo cp /tmp/bats-cli-ui-deps/jq-bin /usr/local/bin/jq
|
||||
- name: Download and unzip pass for Boundary keyring
|
||||
if: steps.dep-cache.outputs.cache-hit != 'true'
|
||||
# NOTE: if you update the password store version make sure to update the dep cache key
|
||||
run: |
|
||||
mkdir -p /tmp/bats-cli-ui-deps/pass
|
||||
wget https://git.zx2c4.com/password-store/snapshot/password-store-1.7.4.tar.xz -O /tmp/bats-cli-ui-deps/pass/pass.tar.xz
|
||||
cd /tmp/bats-cli-ui-deps/pass
|
||||
tar -xvf pass.tar.xz
|
||||
- name: Install pass for Boundary keyring
|
||||
run: |
|
||||
cd /tmp/bats-cli-ui-deps/pass/password-store-1.7.4
|
||||
sudo make install
|
||||
pass init ${{ secrets.ENOS_GPG_UID }}
|
||||
- name: Download Vault AMD64 binary for integration testing
|
||||
if: steps.dep-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget https://releases.hashicorp.com/vault/1.12.2/vault_1.12.2_linux_amd64.zip -O /tmp/bats-cli-ui-deps/vault.zip
|
||||
- name: Install Vault
|
||||
run: |
|
||||
unzip /tmp/bats-cli-ui-deps/vault.zip -d /usr/local/bin
|
||||
- name: Download Linux AMD64 Boundary bundle
|
||||
id: download
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip
|
||||
path: /tmp
|
||||
- name: Unpack boundary bundle
|
||||
run: |
|
||||
unzip ${{steps.download.outputs.download-path}}/boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip -d /usr/local/bin
|
||||
rm ${{steps.download.outputs.download-path}}/boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip
|
||||
- name: Versions
|
||||
run: |
|
||||
echo "go version:"
|
||||
go version
|
||||
echo "bats version:"
|
||||
bats --version
|
||||
echo "jq version:"
|
||||
jq --version
|
||||
echo "gpg version:"
|
||||
gpg --version
|
||||
echo "pass version:"
|
||||
pass --version
|
||||
echo "bash version:"
|
||||
bash --version
|
||||
echo "boundary version:"
|
||||
boundary version
|
||||
echo "vault version:"
|
||||
vault version
|
||||
- name: Run cli bats tests
|
||||
run: |
|
||||
export VAULT_ADDR=http://127.0.0.1:8200
|
||||
export VAULT_TOKEN=boundarytok
|
||||
make -C internal/tests/cli test-vault-up
|
||||
until vault status; do docker container inspect boundary-cli-tests-vault &> /dev/null || exit -1; sleep 1; done
|
||||
make test-cli
|
||||
- name: Cleanup
|
||||
if: success() || failure()
|
||||
run: |
|
||||
make -C internal/tests/cli test-vault-down
|
||||
- name: Send Slack message
|
||||
if: ${{ failure() }}
|
||||
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
|
||||
with:
|
||||
channel-id: ${{ secrets.SLACK_BOUNDARY_TEST_BOT_CHANNEL_ID }}
|
||||
payload: |
|
||||
{
|
||||
"text": ":x: bats tests failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Branch:* ${{ github.event.ref }}\n*SHA:* <${{ github.event.head_commit.url }}|${{ github.event.after }}>"
|
||||
}
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOUNDARY_TEST_BOT_TOKEN }}
|
||||
@@ -19,10 +19,10 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.SERVICE_USER_GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # TSCCR: could not find tsccr entry for hashicorp/setup-terraform
|
||||
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
terraform_wrapper: false
|
||||
- uses: hashicorp/action-setup-enos@v1 # TSCCR: could not find tsccr entry for hashicorp/action-setup-enos
|
||||
- uses: hashicorp/action-setup-enos@v1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
github-token: ${{ secrets.SERVICE_USER_GITHUB_TOKEN }}
|
||||
- name: "check formatting"
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
- name: Determine go cache key
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-bin=$(go env GOPATH)/bin" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
@@ -84,11 +84,11 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ needs.setup.outputs.cache-go-build }}
|
||||
@@ -99,14 +99,14 @@ jobs:
|
||||
${{ runner.os }}-go
|
||||
fail-on-cache-miss: true
|
||||
- name: Set up Terraform
|
||||
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # TSCCR: could not find tsccr entry for hashicorp/setup-terraform
|
||||
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
# the terraform wrapper will break Terraform execution in enos because
|
||||
# it changes the output to text when we expect it to be JSON.
|
||||
terraform_wrapper: false
|
||||
- name: Import GPG key for Boundary pass keystore
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # TSCCR: could not find tsccr entry for crazy-max/ghaction-import-gpg
|
||||
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5.2.0
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.ENOS_GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.ENOS_GPG_PASSPHRASE }}
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
echo "trusted-key ${{ secrets.ENOS_GPG_UID }}" >> ~/.gnupg/gpg.conf
|
||||
cat ~/.gnupg/gpg.conf
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # TSCCR: could not find tsccr entry for aws-actions/configure-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CI }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CI }}
|
||||
@@ -126,7 +126,7 @@ jobs:
|
||||
role-skip-session-tagging: true
|
||||
role-duration-seconds: 3600
|
||||
- name: Set up Enos
|
||||
uses: hashicorp/action-setup-enos@v1 # TSCCR: could not find tsccr entry for hashicorp/action-setup-enos
|
||||
uses: hashicorp/action-setup-enos@v1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
with:
|
||||
github-token: ${{ secrets.SERVICE_USER_GITHUB_TOKEN }}
|
||||
- name: Set up AWS SSH private key
|
||||
@@ -136,7 +136,7 @@ jobs:
|
||||
chmod 600 ./enos/support/private_key.pem
|
||||
- name: Set up dependency cache
|
||||
id: dep-cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: /tmp/test-deps
|
||||
key: enos-test-deps-password-store-1.7.4-vault-1.12.2
|
||||
@@ -192,12 +192,12 @@ jobs:
|
||||
run: |
|
||||
mv ${{ steps.download-docker.outputs.download-path }}/*.tar enos/support/boundary_docker_image.tar
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v3
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
if: matrix.filter == 'e2e_ui builder:crt'
|
||||
with:
|
||||
node-version: '16.x'
|
||||
- name: Checkout boundary-ui
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
if: matrix.filter == 'e2e_ui builder:crt'
|
||||
with:
|
||||
repository: hashicorp/boundary-ui
|
||||
@@ -254,7 +254,7 @@ jobs:
|
||||
retention-days: 5
|
||||
- name: Upload e2e UI tests debug info
|
||||
if: matrix.filter == 'e2e_ui builder:crt' && steps.run.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: test-e2e-ui-debug
|
||||
path: enos/support/boundary-ui/ui/admin/tests/e2e/artifacts/test-failures
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.JIRA_SYNC_GITHUB_TOKEN }}
|
||||
|
||||
- name: Login
|
||||
uses: atlassian/gajira-login@45fd029b9f1d6d8926c6f04175aa80c0e42c9026 # TSCCR: could not find tsccr entry for atlassian/gajira-login
|
||||
uses: atlassian/gajira-login@ca13f8850ea309cf44a6e4e0c49d9aa48ac3ca4c # v3
|
||||
env:
|
||||
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
|
||||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
|
||||
- name: Create ticket
|
||||
if: github.event.action == 'opened' && !steps.boundary-team-role.outputs.role
|
||||
uses: tomhjp/gh-action-jira-create@3ed1789cad3521292e591a7cfa703215ec1348bf # TSCCR: could not find tsccr entry for tomhjp/gh-action-jira-create
|
||||
uses: tomhjp/gh-action-jira-create@3ed1789cad3521292e591a7cfa703215ec1348bf # v0.2.1
|
||||
with:
|
||||
project: ICU
|
||||
issuetype: "GH Issue"
|
||||
@@ -63,28 +63,28 @@ jobs:
|
||||
- name: Search
|
||||
if: github.event.action != 'opened'
|
||||
id: search
|
||||
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # TSCCR: could not find tsccr entry for tomhjp/gh-action-jira-search
|
||||
uses: tomhjp/gh-action-jira-search@04700b457f317c3e341ce90da5a3ff4ce058f2fa # v0.2.2
|
||||
with:
|
||||
# cf[10089] is Issue Link custom field
|
||||
jql: 'issuetype = "GH Issue" and cf[10089]="${{ github.event.issue.html_url || github.event.pull_request.html_url }}"'
|
||||
|
||||
- name: Sync comment
|
||||
if: github.event.action == 'created' && steps.search.outputs.issue
|
||||
uses: tomhjp/gh-action-jira-comment@6eb6b9ead70221916b6badd118c24535ed220bd9 # TSCCR: could not find tsccr entry for tomhjp/gh-action-jira-comment
|
||||
uses: tomhjp/gh-action-jira-comment@6eb6b9ead70221916b6badd118c24535ed220bd9 # v0.2.0
|
||||
with:
|
||||
issue: ${{ steps.search.outputs.issue }}
|
||||
comment: "${{ github.actor }} ${{ github.event.review.state || 'commented' }}:\n\n${{ github.event.comment.body || github.event.review.body }}\n\n${{ github.event.comment.html_url || github.event.review.html_url }}"
|
||||
|
||||
- name: Close ticket
|
||||
if: (github.event.action == 'closed' || github.event.action == 'deleted') && steps.search.outputs.issue
|
||||
uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # TSCCR: could not find tsccr entry for atlassian/gajira-transition
|
||||
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
|
||||
with:
|
||||
issue: ${{ steps.search.outputs.issue }}
|
||||
transition: Done
|
||||
|
||||
- name: Reopen ticket
|
||||
if: github.event.action == 'reopened' && steps.search.outputs.issue
|
||||
uses: atlassian/gajira-transition@38fc9cd61b03d6a53dd35fcccda172fe04b36de3 # TSCCR: could not find tsccr entry for atlassian/gajira-transition
|
||||
uses: atlassian/gajira-transition@4749176faf14633954d72af7a44d7f2af01cc92b # v3
|
||||
with:
|
||||
issue: ${{ steps.search.outputs.issue }}
|
||||
transition: "To Do"
|
||||
@@ -10,6 +10,6 @@ jobs:
|
||||
triage:
|
||||
runs-on: ${{ fromJSON(vars.RUNNER) }}
|
||||
steps:
|
||||
- uses: actions/labeler@ba790c862c380240c6d5e7427be5ace9a05c754b # TSCCR: could not find tsccr entry for actions/labeler
|
||||
- uses: actions/labeler@ba790c862c380240c6d5e7427be5ace9a05c754b # v4.0.3
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
echo "Building with Go $(cat .go-version)"
|
||||
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ steps.get-go-version.outputs.go-version }}"
|
||||
- name: Install Dependencies
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
echo "Building with Go $(cat .go-version)"
|
||||
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ steps.get-go-version.outputs.go-version }}"
|
||||
- name: Install Dependencies
|
||||
|
||||
@@ -45,9 +45,9 @@ jobs:
|
||||
# getdiff echoes the diff in GitHub markdown syntax or "Unchanged" if
|
||||
# the file is empty.
|
||||
getdiff() {
|
||||
if [[ -s $1 ]]; then
|
||||
if [[ -s "$1" ]]; then
|
||||
echo \`\`\`diff
|
||||
echo "$(cat $1)"
|
||||
cat "$1"
|
||||
echo \`\`\`
|
||||
else
|
||||
echo "Unchanged"
|
||||
@@ -95,4 +95,4 @@ jobs:
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-d @body.json \
|
||||
$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/${{ github.event.pull_request.number }}/comments
|
||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/${{ github.event.pull_request.number }}/comments"
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ steps.get-go-version.outputs.go-version }}"
|
||||
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
repository: "$PWD"
|
||||
|
||||
- name: Upload SARIF file
|
||||
uses: github/codeql-action/upload-sarif@e00cd12e3ee0ce24d476645336a315351be51d88 # TSCCR: actions in subdirectories not yet supported: upload-sarif
|
||||
uses: github/codeql-action/upload-sarif@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
@@ -29,9 +29,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up Terraform
|
||||
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # TSCCR: could not find tsccr entry for hashicorp/setup-terraform
|
||||
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # TSCCR: could not find tsccr entry for aws-actions/configure-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CI }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CI }}
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
regions: ${{steps.regions.outputs.regions}}
|
||||
steps:
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # TSCCR: could not find tsccr entry for aws-actions/configure-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CI }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CI }}
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
steps:
|
||||
- name: Configure AWS credentials
|
||||
id: aws-configure
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # TSCCR: could not find tsccr entry for aws-actions/configure-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CI }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CI }}
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
region: ${{ fromJSON(needs.setup.outputs.regions) }}
|
||||
steps:
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # TSCCR: could not find tsccr entry for aws-actions/configure-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CI }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CI }}
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
name: test-cli-ui
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
workflow_run:
|
||||
workflows: [ build ]
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
set-product-version:
|
||||
runs-on: ${{ fromJSON(vars.RUNNER) }}
|
||||
outputs:
|
||||
product-version: ${{ steps.set-product-version.outputs.product-version }}
|
||||
base-product-version: $${{ steps.set-product-version.outputs.base-product-version }}
|
||||
prerelease-product-version: ${{ steps.set-product-version.outputs.prerelease-product-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set Product version
|
||||
id: set-product-version
|
||||
uses: hashicorp/actions-set-product-version@v1 # TSCCR: loading action configs: failed to query HEAD reference: failed to get advertised references: authorization failed
|
||||
|
||||
bats:
|
||||
runs-on: ${{ fromJSON(vars.RUNNER) }}
|
||||
name: CLI tests
|
||||
if: "! github.event.pull_request.head.repo.fork"
|
||||
needs:
|
||||
- set-product-version
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Import GPG key for Boundary pass keystore
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5.2.0
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.ENOS_GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.ENOS_GPG_PASSPHRASE }}
|
||||
- name: Trust the pass keystore GPG key
|
||||
id: trust_gpg
|
||||
run: |
|
||||
gpg -a --encrypt -r ${{ secrets.ENOS_GPG_UID }} --trust-model always
|
||||
echo "trusted-key ${{ secrets.ENOS_GPG_UID }}" >> ~/.gnupg/gpg.conf
|
||||
cat ~/.gnupg/gpg.conf
|
||||
- name: Set up Bats CLI UI tests dependency cache
|
||||
id: dep-cache
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: /tmp/bats-cli-ui-deps
|
||||
key: enos-bats-cli-ui-deps-jq-1.6-password-store-1.7.4-vault-1.12.2
|
||||
- name: Set up Node for Bats install
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install Bats via NPM
|
||||
# Use npm so this workflow is portable on multiple runner distros
|
||||
run: npm install --location=global bats
|
||||
- name: Download jq for Bats CLI UI tests
|
||||
if: steps.dep-cache.outputs.cache-hit != 'true'
|
||||
# NOTE: if you update the jq version make sure to update the dep cache key
|
||||
run: |
|
||||
mkdir -p /tmp/bats-cli-ui-deps
|
||||
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O /tmp/bats-cli-ui-deps/jq-bin
|
||||
- name: Install jq for Bats CLI UI tests
|
||||
run: |
|
||||
chmod +x /tmp/bats-cli-ui-deps/jq-bin
|
||||
sudo cp /tmp/bats-cli-ui-deps/jq-bin /usr/local/bin/jq
|
||||
- name: Download and unzip pass for Boundary keyring
|
||||
if: steps.dep-cache.outputs.cache-hit != 'true'
|
||||
# NOTE: if you update the password store version make sure to update the dep cache key
|
||||
run: |
|
||||
mkdir -p /tmp/bats-cli-ui-deps/pass
|
||||
wget https://git.zx2c4.com/password-store/snapshot/password-store-1.7.4.tar.xz -O /tmp/bats-cli-ui-deps/pass/pass.tar.xz
|
||||
cd /tmp/bats-cli-ui-deps/pass
|
||||
tar -xvf pass.tar.xz
|
||||
- name: Install pass for Boundary keyring
|
||||
run: |
|
||||
cd /tmp/bats-cli-ui-deps/pass/password-store-1.7.4
|
||||
sudo make install
|
||||
pass init ${{ secrets.ENOS_GPG_UID }}
|
||||
- name: Download Vault AMD64 binary for integration testing
|
||||
if: steps.dep-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget https://releases.hashicorp.com/vault/1.12.2/vault_1.12.2_linux_amd64.zip -O /tmp/bats-cli-ui-deps/vault.zip
|
||||
- name: Install Vault
|
||||
run: |
|
||||
unzip /tmp/bats-cli-ui-deps/vault.zip -d /usr/local/bin
|
||||
- name: Download Linux AMD64 Boundary bundle
|
||||
uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2.26.0
|
||||
with:
|
||||
workflow: build.yml
|
||||
commit: ${{ github.sha }}
|
||||
name: boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip
|
||||
path: /tmp
|
||||
- name: Unpack boundary bundle
|
||||
run: |
|
||||
unzip /tmp/boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip -d /usr/local/bin
|
||||
rm /tmp/boundary_${{ needs.set-product-version.outputs.product-version }}_linux_amd64.zip
|
||||
- name: Versions
|
||||
run: |
|
||||
echo "go version:"
|
||||
go version
|
||||
echo "bats version:"
|
||||
bats --version
|
||||
echo "jq version:"
|
||||
jq --version
|
||||
echo "gpg version:"
|
||||
gpg --version
|
||||
echo "pass version:"
|
||||
pass --version
|
||||
echo "bash version:"
|
||||
bash --version
|
||||
echo "boundary version:"
|
||||
boundary version
|
||||
echo "vault version:"
|
||||
vault version
|
||||
- name: Run cli bats tests
|
||||
run: |
|
||||
export VAULT_ADDR=http://127.0.0.1:8200
|
||||
export VAULT_TOKEN=boundarytok
|
||||
make -C internal/tests/cli test-vault-up
|
||||
until vault status; do docker container inspect boundary-cli-tests-vault &> /dev/null || exit 255; sleep 1; done
|
||||
make test-cli
|
||||
- name: Cleanup
|
||||
if: success() || failure()
|
||||
run: |
|
||||
make -C internal/tests/cli test-vault-down
|
||||
- name: Send Slack message
|
||||
if: ${{ failure() }}
|
||||
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
|
||||
with:
|
||||
channel-id: ${{ secrets.SLACK_BOUNDARY_TEST_BOT_CHANNEL_ID }}
|
||||
payload: |
|
||||
{
|
||||
"text": ":x: bats tests failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Branch:* ${{ github.event.ref }}\n*SHA:* <${{ github.event.head_commit.url }}|${{ github.event.after }}>"
|
||||
}
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOUNDARY_TEST_BOT_TOKEN }}
|
||||
+11
-11
@@ -34,7 +34,7 @@ jobs:
|
||||
echo "Building with Go $(cat .go-version)"
|
||||
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ steps.get-go-version.outputs.go-version }}"
|
||||
- name: Determine go cache key
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
||||
echo "go-bin=$(go env GOPATH)/bin" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ steps.go-cache-paths.outputs.go-build }}
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
echo "path=plugins/**/assets/*.gz" >> "$GITHUB_OUTPUT"
|
||||
- name: Set up plugin cache
|
||||
id: plugin-cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ steps.plugin-cache-paths.outputs.path }}
|
||||
@@ -92,11 +92,11 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ needs.setup.outputs.go-version }}"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ needs.setup.outputs.cache-go-build }}
|
||||
@@ -119,11 +119,11 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ needs.setup.outputs.go-version }}"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ needs.setup.outputs.cache-go-build }}
|
||||
@@ -154,11 +154,11 @@ jobs:
|
||||
ulimit -Ha
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
||||
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
||||
with:
|
||||
go-version: "${{ needs.setup.outputs.go-version }}"
|
||||
- name: Set up Go modules cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ needs.setup.outputs.cache-go-build }}
|
||||
@@ -170,7 +170,7 @@ jobs:
|
||||
fail-on-cache-miss: true
|
||||
- name: Set up plugin cache
|
||||
id: plugin-cache
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
|
||||
with:
|
||||
path: |
|
||||
${{ needs.setup.outputs.plugin-cache-path }}
|
||||
@@ -184,7 +184,7 @@ jobs:
|
||||
until pg_isready -h 127.0.0.1; do docker container inspect boundary-sql-tests &> /dev/null || exit 255; sleep 1; done
|
||||
|
||||
- name: Test
|
||||
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2.8.3
|
||||
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # TSCCR: no entry for repository "nick-fields/retry"
|
||||
env:
|
||||
TEST_PACKAGE: "${{ matrix.package }}"
|
||||
GOMAXPROCS: ${{ vars.TEST_GOMAXPROCS }}
|
||||
|
||||
Reference in new issue
Block a user