mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
8479b69566
Bumps the gha-dependencies group with 1 update: [actions/setup-go](https://github.com/actions/setup-go). Updates `actions/setup-go` from 6.3.0 to 6.4.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/4b73464bb391d4059bd26b0524d20df3927bd417...4a3601121dd01d1626a1e23e37211e3254c1c06c) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: gha-dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
236 lines
7.5 KiB
YAML
236 lines
7.5 KiB
YAML
name: Post Merge
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
generate:
|
|
permissions:
|
|
contents: write # for Git to git push
|
|
name: Sync Generated Code and Docs
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
token: ${{ secrets.GH_PUSH_TOKEN }} # zizmor: ignore[secrets-outside-env] required to push to protected branch below
|
|
persist-credentials: true
|
|
|
|
- name: Generate
|
|
run: make clean generate docs-generate-cli-docs
|
|
|
|
- name: Commit & Push
|
|
shell: bash
|
|
run: |
|
|
# Commit any changes and push as needed.
|
|
|
|
# See https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
|
|
AUTHOR=wasm-updater
|
|
git config user.name ${AUTHOR}
|
|
git config user.email ${AUTHOR}@github.com
|
|
|
|
# Prevent looping if the build was non-deterministic..
|
|
CAN_PUSH=1
|
|
if [[ "$(git log -1 --pretty=format:'%an')" == "${AUTHOR}" ]]; then
|
|
CAN_PUSH=0
|
|
fi
|
|
|
|
if ./build/commit-wasm-bins.sh; then
|
|
if [[ "${CAN_PUSH}" == "1" ]]; then
|
|
git push
|
|
else
|
|
echo "Previous commit was auto-generated -- Aborting!"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "No generated changes to push!"
|
|
fi
|
|
|
|
AUTHOR=cli-docs-updater
|
|
git config user.name ${AUTHOR}
|
|
git config user.email ${AUTHOR}@github.com
|
|
|
|
# Prevent looping if the build was non-deterministic..
|
|
CAN_PUSH=1
|
|
if [[ "$(git log -1 --pretty=format:'%an')" == "${AUTHOR}" ]]; then
|
|
CAN_PUSH=0
|
|
fi
|
|
|
|
if ./build/commit-cli-docs.sh; then
|
|
if [[ "${CAN_PUSH}" == "1" ]]; then
|
|
git push
|
|
else
|
|
echo "Previous commit was auto-generated -- Aborting!"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "No generated changes to push!"
|
|
fi
|
|
|
|
code-coverage:
|
|
name: Update Go Test Coverage
|
|
runs-on: ubuntu-24.04
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Unit Test Golang
|
|
run: make ci-go-test-coverage
|
|
timeout-minutes: 30
|
|
|
|
release-build:
|
|
name: Release Build (linux, windows)
|
|
runs-on: ubuntu-24.04
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
persist-credentials: false
|
|
|
|
- name: Git Describe
|
|
run: git describe --tags
|
|
|
|
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
|
|
with:
|
|
version: '0.15.2'
|
|
|
|
- id: go_version
|
|
name: Read go version
|
|
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Go (${{ steps.go_version.outputs.go_version }})
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: ${{ steps.go_version.outputs.go_version }}
|
|
|
|
- name: Build Linux and Windows
|
|
run: make ci-build-windows ci-go-ci-build-linux ci-go-ci-build-linux-static
|
|
timeout-minutes: 30
|
|
|
|
- name: Build Linux arm64
|
|
run: make ci-go-ci-build-linux ci-go-ci-build-linux-static
|
|
timeout-minutes: 30
|
|
env:
|
|
GOARCH: arm64
|
|
|
|
- name: Upload binaries
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
if: always()
|
|
with:
|
|
name: binaries-linux-windows
|
|
path: _release
|
|
|
|
release-build-darwin:
|
|
name: Release Build (darwin)
|
|
runs-on: macos-14
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
persist-credentials: false
|
|
|
|
- name: Git Describe
|
|
run: git describe --tags
|
|
|
|
- id: go_version
|
|
name: Read go version
|
|
run: echo "go_version=$(cat .go-version)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Go (${{ steps.go_version.outputs.go_version }})
|
|
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
|
|
with:
|
|
go-version: ${{ steps.go_version.outputs.go_version }}
|
|
|
|
- name: Build Darwin
|
|
run: |
|
|
make ci-build-darwin GOARCH=amd64
|
|
make ci-build-darwin-arm64-static
|
|
timeout-minutes: 30
|
|
|
|
- name: Upload binaries (darwin)
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
if: always()
|
|
with:
|
|
name: binaries-darwin
|
|
path: _release
|
|
|
|
deploy-edge:
|
|
name: Push Edge Release
|
|
runs-on: ubuntu-24.04
|
|
needs: [release-build, release-build-darwin]
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Test
|
|
run: make ci-release-test
|
|
timeout-minutes: 60
|
|
|
|
- name: Download release binaries
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
pattern: binaries-*
|
|
merge-multiple: true
|
|
path: _release
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
|
|
- name: Deploy OPA Edge
|
|
env:
|
|
DOCKER_USER: ${{ secrets.DOCKER_USER }} # zizmor: ignore[secrets-outside-env]
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} # zizmor: ignore[secrets-outside-env]
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} # zizmor: ignore[secrets-outside-env]
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # zizmor: ignore[secrets-outside-env]
|
|
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }} # zizmor: ignore[secrets-outside-env]
|
|
S3_RELEASE_BUCKET: ${{ secrets.S3_RELEASE_BUCKET }} # zizmor: ignore[secrets-outside-env]
|
|
# Only run if required secrets are provided
|
|
if: ${{ env.S3_RELEASE_BUCKET && env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY && env.DOCKER_USER && env.DOCKER_PASSWORD }}
|
|
run: make deploy-ci
|
|
|
|
deploy-wasm-builder:
|
|
name: Deploy WASM Builder
|
|
runs-on: ubuntu-24.04
|
|
needs: generate
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Build and Push opa-wasm-builder
|
|
env:
|
|
DOCKER_USER: ${{ secrets.DOCKER_USER }} # zizmor: ignore[secrets-outside-env]
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} # zizmor: ignore[secrets-outside-env]
|
|
DOCKER_WASM_BUILDER_IMAGE: ${{ secrets.DOCKER_WASM_BUILDER_IMAGE }} # zizmor: ignore[secrets-outside-env]
|
|
# Only run if required secrets are provided
|
|
if: ${{ env.DOCKER_USER && env.DOCKER_PASSWORD }}
|
|
run: make push-wasm-builder-image
|
|
|
|
website-smoke-test:
|
|
name : Website Smoke Test
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Run Smoke Test
|
|
run: make -C docs smoke-test
|