diff --git a/.github/workflows/kfc-v10-tests.yml b/.github/workflows/kfc-v10-tests.yml new file mode 100644 index 0000000..3885671 --- /dev/null +++ b/.github/workflows/kfc-v10-tests.yml @@ -0,0 +1,111 @@ +name: Command V10 Tests + +on: + workflow_dispatch: + push: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Install dependencies + run: go mod download && go mod tidy + - name: Install Azure CLI + run: | + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + az --version + + ### Store Type Tests + Test_StoreTypes: + runs-on: ubuntu-latest + needs: + - build + env: + SECRET_NAME: "command-config-1050-clean" + KEYFACTOR_HOSTNAME: "int1050-test-clean.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: | + export KFUTIL_DEBUG=1 + go test -v ./cmd -run "^Test_StoreTypes*" + + ### Store Tests + Test_Stores: + runs-on: ubuntu-latest + needs: + - build + - Test_StoreTypes + env: + SECRET_NAME: "command-config-1050" + KEYFACTOR_HOSTNAME: "integrations1050-lab.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: go test -v ./cmd -run "^Test_Stores_*" + + ### PAM Tests + Test_PAM: + runs-on: ubuntu-latest + needs: + - build + + - Test_StoreTypes + env: + SECRET_NAME: "command-config-1050" + KEYFACTOR_HOSTNAME: "integrations1050-lab.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: | + unset KFUTIL_DEBUG + go test -v ./cmd -run "^Test_PAM*" + + + ### PAM Tests AKV Auth Provider + Test_AKV_PAM: + runs-on: self-hosted + needs: + - Test_PAM + env: + SECRET_NAME: "command-config-1050-az" + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Install dependencies + run: go mod download && go mod tidy + - name: Get secret from Azure Key Vault + run: | + . ./examples/auth/akv/akv_auth.sh + cat $HOME/.keyfactor/command_config.json + - name: Install kfutil + run: | + make install + - name: Run tests + run: | + go test -v ./cmd -run "^Test_PAM*" + diff --git a/.github/workflows/kfc-v11-tests.yml b/.github/workflows/kfc-v11-tests.yml new file mode 100644 index 0000000..e2306f5 --- /dev/null +++ b/.github/workflows/kfc-v11-tests.yml @@ -0,0 +1,111 @@ +name: Command V11 Tests + +on: + workflow_dispatch: + push: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Install dependencies + run: go mod download && go mod tidy + - name: Install Azure CLI + run: | + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + az --version + + ### Store Type Tests + Test_StoreTypes: + runs-on: ubuntu-latest + needs: + - build + env: + SECRET_NAME: "command-config-1050-clean" + KEYFACTOR_HOSTNAME: "int1050-test-clean.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: | + export KFUTIL_DEBUG=1 + go test -v ./cmd -run "^Test_StoreTypes*" + + ### Store Tests + Test_Stores: + runs-on: ubuntu-latest + needs: + - build + - Test_StoreTypes + env: + SECRET_NAME: "command-config-1050" + KEYFACTOR_HOSTNAME: "integrations1050-lab.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: go test -v ./cmd -run "^Test_Stores_*" + + ### PAM Tests + Test_PAM: + runs-on: ubuntu-latest + needs: + - build + + - Test_StoreTypes + env: + SECRET_NAME: "command-config-1050" + KEYFACTOR_HOSTNAME: "integrations1050-lab.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: | + unset KFUTIL_DEBUG + go test -v ./cmd -run "^Test_PAM*" + + + ### PAM Tests AKV Auth Provider + Test_AKV_PAM: + runs-on: self-hosted + needs: + - Test_PAM + env: + SECRET_NAME: "command-config-1050-az" + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Install dependencies + run: go mod download && go mod tidy + - name: Get secret from Azure Key Vault + run: | + . ./examples/auth/akv/akv_auth.sh + cat $HOME/.keyfactor/command_config.json + - name: Install kfutil + run: | + make install + - name: Run tests + run: | + go test -v ./cmd -run "^Test_PAM*" + diff --git a/.github/workflows/kfc-v12-tests.yml b/.github/workflows/kfc-v12-tests.yml new file mode 100644 index 0000000..893628c --- /dev/null +++ b/.github/workflows/kfc-v12-tests.yml @@ -0,0 +1,111 @@ +name: Command V12 Tests + +on: + workflow_dispatch: + push: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Install dependencies + run: go mod download && go mod tidy + - name: Install Azure CLI + run: | + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + az --version + + ### Store Type Tests + Test_StoreTypes: + runs-on: ubuntu-latest + needs: + - build + env: + SECRET_NAME: "command-config-1200-clean" + KEYFACTOR_HOSTNAME: "int1200-test-clean.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: | + export KFUTIL_DEBUG=1 + go test -v ./cmd -run "^Test_StoreTypes*" + + ### Store Tests + Test_Stores: + runs-on: ubuntu-latest + needs: + - build + - Test_StoreTypes + env: + SECRET_NAME: "command-config-1200" + KEYFACTOR_HOSTNAME: "integrations1200-lab.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: go test -v ./cmd -run "^Test_Stores_*" + + ### PAM Tests + Test_PAM: + runs-on: ubuntu-latest + needs: + - build + + - Test_StoreTypes + env: + SECRET_NAME: "command-config-1200" + KEYFACTOR_HOSTNAME: "integrations1200-lab.kfdelivery.com" + KEYFACTOR_DOMAIN: "command" + KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} + KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Run tests + run: | + unset KFUTIL_DEBUG + go test -v ./cmd -run "^Test_PAM*" + + + ### PAM Tests AKV Auth Provider + Test_AKV_PAM: + runs-on: self-hosted + needs: + - Test_PAM + env: + SECRET_NAME: "command-config-1200-az" + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + - name: Install dependencies + run: go mod download && go mod tidy + - name: Get secret from Azure Key Vault + run: | + . ./examples/auth/akv/akv_auth.sh + cat $HOME/.keyfactor/command_config.json + - name: Install kfutil + run: | + make install + - name: Run tests + run: | + go test -v ./cmd -run "^Test_PAM*" + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 8580a26..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,356 +0,0 @@ -name: go tests - -on: -# workflow_dispatch: -# workflow_run: -# workflows: -# - "Check and Update Package Version" -# types: -# - completed -# branches: -# - "*" - push: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - name: Install dependencies - run: go mod download && go mod tidy - - name: Install Azure CLI - run: | - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - az --version - - # 10.x.x - kf_10_x_x: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: echo "Running tests for KF 10.x.x" - - ### Store Type Tests - Test_StoreTypes_KFC_10_5_0: - runs-on: ubuntu-latest - needs: - - build - - kf_10_x_x - env: - SECRET_NAME: "command-config-1050-clean" - KEYFACTOR_HOSTNAME: "int1050-test-clean.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: | - export KFUTIL_DEBUG=1 - go test -v ./cmd -run "^Test_StoreTypes*" - - ### Store Tests - Test_Stores_KFC_10_5_0: - runs-on: ubuntu-latest - needs: - - build - - kf_10_x_x - - Test_StoreTypes_KFC_10_5_0 - env: - SECRET_NAME: "command-config-1050" - KEYFACTOR_HOSTNAME: "integrations1050-lab.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: go test -v ./cmd -run "^Test_Stores_*" - - ### PAM Tests - Test_PAM_KFC_10_5_0: - runs-on: ubuntu-latest - needs: - - build - - kf_10_x_x - - Test_StoreTypes_KFC_10_5_0 - env: - SECRET_NAME: "command-config-1050" - KEYFACTOR_HOSTNAME: "integrations1050-lab.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: | - unset KFUTIL_DEBUG - go test -v ./cmd -run "^Test_PAM*" - - - ### PAM Tests AKV Auth Provider - Test_AKV_PAM_KFC_10_5_0: - runs-on: self-hosted - needs: - - Test_PAM_KFC_10_5_0 - env: - SECRET_NAME: "command-config-1050-az" - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - name: Install dependencies - run: go mod download && go mod tidy - - name: Get secret from Azure Key Vault - run: | - . ./examples/auth/akv/akv_auth.sh - cat $HOME/.keyfactor/command_config.json - - name: Install kfutil - run: | - make install - - name: Run tests - run: | - go test -v ./cmd -run "^Test_PAM*" - - - ## KFC 11.x.x - kf_11_x_x: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: echo "Running tests for KF 11.x.x" - - ### Store Type Tests - Test_StoreTypes_KFC_11_2_0: - runs-on: ubuntu-latest - needs: - - build - - kf_11_x_x - env: - SECRET_NAME: "command-config-1120-clean" - KEYFACTOR_HOSTNAME: "int1120-test-clean.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: | - unset KFUTIL_DEBUG - go test -v ./cmd -run "^Test_StoreTypes*" - - Test_StoreTypes_KFC_11_1_2: - runs-on: ubuntu-latest - needs: - - build - - kf_11_x_x - env: - SECRET_NAME: "command-config-1112-clean" - KEYFACTOR_HOSTNAME: "int1112-test-clean.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: | - unset KFUTIL_DEBUG - go test -v ./cmd -run "^Test_StoreTypes*" - - - ### Store Tests - Test_Stores_KFC_11_2_0: - runs-on: ubuntu-latest - needs: - - build - - kf_11_x_x - - Test_StoreTypes_KFC_11_2_0 - env: - SECRET_NAME: "command-config-1120" - KEYFACTOR_HOSTNAME: "integrations1120-lab.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: go test -v ./cmd -run "^Test_Stores_*" - Test_Stores_KFC_11_1_2: - runs-on: ubuntu-latest - needs: - - build - - kf_11_x_x - - Test_StoreTypes_KFC_11_1_2 - env: - SECRET_NAME: "command-config-1112" - KEYFACTOR_HOSTNAME: "integrations1112-lab.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: go test -v ./cmd -run "^Test_Stores_*" - - ### PAM Tests - Test_PAM_KFC_11_2_0: - runs-on: ubuntu-latest - needs: - - build - - kf_11_x_x - - Test_StoreTypes_KFC_11_2_0 - env: - SECRET_NAME: "command-config-1120" - KEYFACTOR_HOSTNAME: "integrations1120-lab.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: | - unset KFUTIL_DEBUG - go test -v ./cmd -run "^Test_PAM*" - - - Test_PAM_KFC_11_1_2: - runs-on: ubuntu-latest - needs: - - build - - kf_11_x_x - - Test_StoreTypes_KFC_11_1_2 - env: - SECRET_NAME: "command-config-1112" - KEYFACTOR_HOSTNAME: "integrations1112-lab.kfdelivery.com" - KEYFACTOR_DOMAIN: "command" - KEYFACTOR_USERNAME: ${{ secrets.LAB_USERNAME }} - KEYFACTOR_PASSWORD: ${{ secrets.LAB_PASSWORD }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Run tests - run: | - unset KFUTIL_DEBUG - go test -v ./cmd -run "^Test_PAM*" - - - ### PAM Tests AKV Auth Provider - Test_AKV_PAM_KFC_11_2_0: - runs-on: self-hosted - needs: - - Test_PAM_KFC_11_2_0 - env: - SECRET_NAME: "command-config-1120-az" - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - name: Install dependencies - run: go mod download && go mod tidy - - name: Get secret from Azure Key Vault - run: | - . ./examples/auth/akv/akv_auth.sh - cat $HOME/.keyfactor/command_config.json - - name: Install kfutil - run: | - make install - - name: Run tests - run: | - go test -v ./cmd -run "^Test_PAM*" - - - Test_AKV_PAM_KFC_11_1_2: - runs-on: self-hosted - needs: - - Test_PAM_KFC_11_1_2 - env: - SECRET_NAME: "command-config-1112-az" - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.21" - - name: Install dependencies - run: go mod download && go mod tidy - - name: Get secret from Azure Key Vault - run: | - . ./examples/auth/akv/akv_auth.sh - cat $HOME/.keyfactor/command_config.json - - name: Install kfutil - run: | - make install - - name: Run tests - run: | - go test -v ./cmd -run "^Test_PAM*" - - - # Tester Install Script - Test_Install_Script: - runs-on: ubuntu-latest - steps: - - name: Test Quick Install Script - run: | - bash <(curl -s https://raw.githubusercontent.com/Keyfactor/kfutil/${GITHUB_REF_NAME}/install.sh) - which kfutil - kfutil version - rm $(which kfutil) - - # Package Tests - Test_Kfutil_pkg: - runs-on: ubuntu-latest - needs: - - build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - # Checkout code - # https://github.com/actions/checkout - - name: Checkout code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Setup GoLang build environment - # https://github.com/actions/setup-go - - name: Set up Go 1.x - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 - with: - go-version-file: 'go.mod' - cache: true - - # Install dependencies - - name: Install dependencies - run: go mod download - - # Run the tests with coverage found in the pkg directory - - name: Run tests - run: go test -v -cover ./pkg/...