Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Feat: CLI Integration tests

Daniel Hougaard4050e56e60da
diff --git a/.github/workflows/release_build_infisical_cli.yml b/.github/workflows/release_build_infisical_cli.yml
index d01d561988..40137a4558 100644
--- a/.github/workflows/release_build_infisical_cli.yml
+++ b/.github/workflows/release_build_infisical_cli.yml
@@ -1,60 +1,64 @@
name: Build and release CLI
on:
- push:
- # run only against tags
- tags:
- - "infisical-cli/v*.*.*"
+ push:
+ # run only against tags
+ tags:
+ - "infisical-cli/v*.*.*"
permissions:
- contents: write
- # packages: write
- # issues: write
-
+ contents: write
+ # packages: write
+ # issues: write
jobs:
- goreleaser:
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- - name: πŸ‹ Login to Docker Hub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: πŸ”§ Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
- - run: git fetch --force --tags
- - run: echo "Ref name ${{github.ref_name}}"
- - uses: actions/setup-go@v3
- with:
- go-version: ">=1.19.3"
- cache: true
- cache-dependency-path: cli/go.sum
- - name: libssl1.1 => libssl1.0-dev for OSXCross
- run: |
- echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list
- sudo apt update && apt-cache policy libssl1.0-dev
- sudo apt-get install libssl1.0-dev
- - name: OSXCross for CGO Support
- run: |
- mkdir ../../osxcross
- git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
- - uses: goreleaser/goreleaser-action@v4
- with:
- distribution: goreleaser-pro
- version: latest
- args: release --clean
- env:
- GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }}
- POSTHOG_API_KEY_FOR_CLI: ${{ secrets.POSTHOG_API_KEY_FOR_CLI }}
- FURY_TOKEN: ${{ secrets.FURYPUSHTOKEN }}
- AUR_KEY: ${{ secrets.AUR_KEY }}
- GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
- - uses: actions/setup-python@v4
- - run: pip install --upgrade cloudsmith-cli
- - name: Publish to CloudSmith
- run: sh cli/upload_to_cloudsmith.sh
- env:
- CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
+ cli-integration-tests:
+ name: Run tests before deployment
+ uses: ./.github/workflows/run-cli-tests.yml
+
+ goreleaser:
+ runs-on: ubuntu-20.04
+ needs: [cli-integration-tests]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: πŸ‹ Login to Docker Hub
+ uses: docker/login-action@v2
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: πŸ”§ Set up Docker Buildx
+ uses: docker/setup-buildx-action@v2
+ - run: git fetch --force --tags
+ - run: echo "Ref name ${{github.ref_name}}"
+ - uses: actions/setup-go@v3
+ with:
+ go-version: ">=1.19.3"
+ cache: true
+ cache-dependency-path: cli/go.sum
+ - name: libssl1.1 => libssl1.0-dev for OSXCross
+ run: |
+ echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list
+ sudo apt update && apt-cache policy libssl1.0-dev
+ sudo apt-get install libssl1.0-dev
+ - name: OSXCross for CGO Support
+ run: |
+ mkdir ../../osxcross
+ git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
+ - uses: goreleaser/goreleaser-action@v4
+ with:
+ distribution: goreleaser-pro
+ version: latest
+ args: release --clean
+ env:
+ GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }}
+ POSTHOG_API_KEY_FOR_CLI: ${{ secrets.POSTHOG_API_KEY_FOR_CLI }}
+ FURY_TOKEN: ${{ secrets.FURYPUSHTOKEN }}
+ AUR_KEY: ${{ secrets.AUR_KEY }}
+ GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
+ - uses: actions/setup-python@v4
+ - run: pip install --upgrade cloudsmith-cli
+ - name: Publish to CloudSmith
+ run: sh cli/upload_to_cloudsmith.sh
+ env:
+ CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
diff --git a/.github/workflows/run-cli-tests.yml b/.github/workflows/run-cli-tests.yml
index 1076228cc5..9cd5d15193 100644
--- a/.github/workflows/run-cli-tests.yml
+++ b/.github/workflows/run-cli-tests.yml
@@ -1,5 +1,12 @@
name: Go CLI Tests
-on: [push] # Test
+
+on:
+ pull_request:
+ types: [opened, synchronize]
+ paths:
+ - "cli/**"
+
+ workflow_call:
jobs:
test: