Skip to content

chore(deps): update ghcr.io/platform-mesh/resource-broker:latest dock… #331

chore(deps): update ghcr.io/platform-mesh/resource-broker:latest dock…

chore(deps): update ghcr.io/platform-mesh/resource-broker:latest dock… #331

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
- id: golangci-version
run: |
echo version="$(grep '^GOLANGCI_LINT_VERSION' Makefile | cut -d' ' -f3)" >> "$GITHUB_OUTPUT"
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
version: ${{ steps.golangci-version.outputs.version }}
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
- run: make test
test-e2e:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
- run: make test-e2e
docker:
needs: lint
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
include:
- image: resource-broker
dockerfile: Dockerfile
- image: resource-broker-kcp
dockerfile: contrib/kcp/Dockerfile
- image: resource-broker-operator
dockerfile: cmd/operator/Dockerfile
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
- uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6
with:
images: ghcr.io/platform-mesh/${{ matrix.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,format=long,prefix=sha-
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
file: ${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: |
type=image,push=${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
list-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- id: list-examples
run: |
{
echo -n 'examples=['
for example in $(find examples -mindepth 1 -maxdepth 1 -type d -printf '%f '); do
[[ -f "examples/$example/.noexample" ]] && continue
echo -n "\"$example\","
done
echo -n ']'
} > "$GITHUB_OUTPUT"
sed -i 's#,]#]#' "$GITHUB_OUTPUT"
outputs:
examples: ${{ steps.list-examples.outputs.examples }}
examples:
needs:
- docker
- list-examples
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: ${{ fromJson(needs.list-examples.outputs.examples) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
- uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
- uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1
with:
# Only install kind without setting up any clusters. Clusters
# will be created as needed in the examples.
install_only: true
# use the gha cache to "transfer" the images built in the previous job to this job
- uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
file: Dockerfile
tags: resource-broker:dev
cache-from: type=gha
push: false
load: true
- uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
file: contrib/kcp/Dockerfile
tags: resource-broker-kcp:dev
cache-from: type=gha
push: false
load: true
- uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
with:
file: cmd/operator/Dockerfile
tags: resource-broker-operator:dev
cache-from: type=gha
push: false
load: true
- uses: ntnn/mdextract@380b5ce9e585364ab79e3e8e8bb7bcb02cbfcecb # v0.4.1
with:
input: ./examples/${{ matrix.example }}/README.md
output: run.bash
tags: bash,ci
- run: bash -xe run.bash
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: failure()
with:
name: logs-${{ matrix.example }}
path: |
*.log
*.yaml
quality-gate:
if: always()
permissions: {}
needs: [lint, test, test-e2e, docker, examples]
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Check results
run: |
if [[ "${{ needs.lint.result }}" != "success" ]]; then
echo "lint failed"
exit 1
fi
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "test failed"
exit 1
fi
if [[ "${{ needs.test-e2e.result }}" != "success" ]]; then
echo "test-e2e failed"
exit 1
fi
if [[ "${{ needs.docker.result }}" != "success" ]]; then
echo "docker failed"
exit 1
fi
if [[ "${{ needs.examples.result }}" != "success" ]]; then
echo "examples failed"
exit 1
fi