mirror of
https://github.com/getsops/sops.git
synced 2026-02-05 12:45:21 +01:00
Bumps the ci group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action), [anchore/sbom-action](https://github.com/anchore/sbom-action) and [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action). Updates `actions/checkout` from 4.2.2 to 5.0.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](11bd71901b...08c6903cd8) Updates `github/codeql-action` from 3.29.8 to 3.29.9 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](76621b61de...df559355d5) Updates `anchore/sbom-action` from 0.20.4 to 0.20.5 - [Release notes](https://github.com/anchore/sbom-action/releases) - [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md) - [Commits](7b36ad622f...da167eac91) Updates `goreleaser/goreleaser-action` from 6.3.0 to 6.4.0 - [Release notes](https://github.com/goreleaser/goreleaser-action/releases) - [Commits](9c156ee8a1...e435ccd777) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci - dependency-name: github/codeql-action dependency-version: 3.29.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ci - dependency-name: anchore/sbom-action dependency-version: 0.20.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ci - dependency-name: goreleaser/goreleaser-action dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ci ... Signed-off-by: dependabot[bot] <support@github.com>
152 lines
5.0 KiB
YAML
152 lines
5.0 KiB
YAML
name: CLI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.go-version }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
os: [linux, darwin, windows]
|
|
arch: [amd64, arm64]
|
|
go-version: ['1.23', '1.24']
|
|
exclude:
|
|
- os: windows
|
|
arch: arm64
|
|
env:
|
|
VAULT_VERSION: "1.14.0"
|
|
VAULT_TOKEN: "root"
|
|
VAULT_ADDR: "http://127.0.0.1:8200"
|
|
steps:
|
|
- name: Set up Go ${{ matrix.go-version }}
|
|
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Vendor Go Modules
|
|
run: make vendor
|
|
|
|
- name: Ensure clean working tree
|
|
run: git diff --exit-code
|
|
|
|
- name: Build ${{ matrix.os }}
|
|
if: matrix.os != 'windows'
|
|
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o sops-${{ matrix.go-version }}-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }} -v ./cmd/sops
|
|
|
|
- name: Build ${{ matrix.os }}
|
|
if: matrix.os == 'windows'
|
|
run: GOOS=${{ matrix.os }} go build -o sops-${{ matrix.go-version }}-${{ matrix.os }}-${{ github.sha }} -v ./cmd/sops
|
|
|
|
- name: Import test GPG keys
|
|
run: for i in 1 2 3 4 5; do gpg --import pgp/sops_functional_tests_key.asc && break || sleep 15; done
|
|
|
|
- name: Test
|
|
run: make test
|
|
|
|
- name: Upload artifact for ${{ matrix.os }}
|
|
if: matrix.os != 'windows'
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: sops-${{ matrix.go-version }}-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }}
|
|
path: sops-${{ matrix.go-version }}-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }}
|
|
|
|
- name: Upload artifact for ${{ matrix.os }}
|
|
if: matrix.os == 'windows'
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: sops-${{ matrix.go-version }}-${{ matrix.os }}-${{ github.sha }}
|
|
path: sops-${{ matrix.go-version }}-${{ matrix.os }}-${{ github.sha }}
|
|
test:
|
|
name: Functional tests
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
strategy:
|
|
matrix:
|
|
go-version: ['1.24']
|
|
env:
|
|
VAULT_VERSION: "1.14.0"
|
|
VAULT_TOKEN: "root"
|
|
VAULT_ADDR: "http://127.0.0.1:8200"
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
# Rustup will detect toolchain version and profile from rust-toolchain.toml
|
|
# It will download and install the toolchain and components automatically
|
|
# and make them available for subsequent commands
|
|
- name: Install Rust toolchain
|
|
run: rustup show
|
|
|
|
- name: Show Rust version
|
|
run: cargo --version
|
|
|
|
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
|
with:
|
|
name: sops-${{ matrix.go-version }}-linux-amd64-${{ github.sha }}
|
|
|
|
- name: Move SOPS binary
|
|
run: mv sops-${{ matrix.go-version }}-linux-amd64-${{ github.sha }} ./functional-tests/sops
|
|
|
|
- name: Make SOPS binary executable
|
|
run: chmod +x ./functional-tests/sops
|
|
|
|
- name: Download Vault
|
|
run: curl -O "https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip" && sudo unzip vault_${VAULT_VERSION}_linux_amd64.zip -d /usr/local/bin/
|
|
|
|
- name: Start Vault server
|
|
run: vault server -dev -dev-root-token-id="$VAULT_TOKEN" &
|
|
|
|
- name: Enable Vault KV
|
|
run: vault secrets enable -version=1 kv
|
|
|
|
- name: Import test GPG keys
|
|
run: for i in 1 2 3 4 5; do gpg --import pgp/sops_functional_tests_key.asc && break || sleep 15; done
|
|
|
|
- name: Run tests
|
|
run: cargo test
|
|
working-directory: ./functional-tests
|
|
|
|
# The 'check' job should depend on all other jobs so it's possible to configure branch protection only for 'check'
|
|
# instead of having to explicitly list all individual jobs that need to pass.
|
|
check:
|
|
if: always()
|
|
|
|
needs:
|
|
- build
|
|
- test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Decide whether the needed jobs succeeded or failed
|
|
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
|
|
with:
|
|
allowed-failures: docs, linters
|
|
allowed-skips: non-voting-flaky-job
|
|
jobs: ${{ toJSON(needs) }}
|