ref(build): Switch LTO profile to thin #1818
Workflow file for this run
This file contains 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: image | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, labeled] | |
push: | |
branches: | |
- master | |
- release/** | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-setup: | |
name: Setup build metadata | |
runs-on: ubuntu-latest | |
env: | |
FULL_CI: "${{ | |
github.event_name != 'pull_request' | |
|| contains(github.event.pull_request.labels.*.name, 'Trigger: Full-CI') | |
}}" | |
steps: | |
- id: set-outputs | |
run: | | |
echo "full_ci=$FULL_CI" >> $GITHUB_OUTPUT | |
if [[ "$FULL_CI" == "true" ]]; then | |
echo "Running full CI" | |
echo 'archs=["amd64", "arm64"]' >> $GITHUB_OUTPUT | |
else | |
echo "Skipping some CI steps" | |
echo 'archs=["amd64"]' >> $GITHUB_OUTPUT | |
fi | |
outputs: | |
archs: "${{ steps.set-outputs.outputs.archs }}" | |
full_ci: "${{ steps.set-outputs.outputs.full_ci }}" | |
build-image: | |
needs: build-setup | |
strategy: | |
matrix: | |
arch: ${{ fromJson(needs.build-setup.outputs.archs) }} | |
runs-on: |- | |
${{fromJson('{ | |
"amd64": "ubuntu-20.04", | |
"arm64": "ubuntu-22.04-arm64-relay" | |
}')[matrix.arch] }} | |
env: | |
IMG_VERSIONED: ghcr.io/getsentry/symbolicator:${{ matrix.arch }}-${{ github.sha }} | |
NIGHTLY_IMG_CACHE: ghcr.io/getsentry/symbolicator:${{ matrix.arch }}-nightly | |
BUILDER_IMG_CACHE: ghcr.io/getsentry/symbolicator:${{ matrix.arch }}-builder | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Docker Login | |
run: docker login --username '${{ github.actor }}' --password '${{ secrets.GITHUB_TOKEN }}' ghcr.io | |
- name: build builder img | |
run: | | |
set -euxo pipefail | |
args=() | |
if docker pull -q "$BUILDER_IMG_CACHE"; then | |
args+=(--cache-from "$BUILDER_IMG_CACHE") | |
fi | |
docker buildx build \ | |
"${args[@]}" \ | |
--build-arg BUILDKIT_INLINE_CACHE=1 \ | |
--platform linux/${{ matrix.arch }} \ | |
--tag "$BUILDER_IMG_CACHE" \ | |
--target symbolicator-build \ | |
. | |
- name: build nightly img | |
run: | | |
set -euxo pipefail | |
args=() | |
if docker pull -q "$NIGHTLY_IMG_CACHE"; then | |
args+=(--cache-from "$NIGHTLY_IMG_CACHE") | |
fi | |
docker buildx build \ | |
"${args[@]}" \ | |
--build-arg BUILDKIT_INLINE_CACHE=1 \ | |
--platform linux/${{ matrix.arch }} \ | |
--tag "$NIGHTLY_IMG_CACHE" \ | |
--tag "$IMG_VERSIONED" \ | |
--cache-from "${BUILDER_IMG_CACHE}" \ | |
--cache-from "${NIGHTLY_IMG_CACHE}" \ | |
. | |
- name: push all images | |
if: github.event_name != 'pull_request' | |
run: docker push "$IMG_VERSIONED" | |
assemble: | |
needs: build-image | |
if: github.event_name != 'pull_request' | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Docker Login | |
run: docker login --username '${{ github.actor }}' --password '${{ secrets.GITHUB_TOKEN }}' ghcr.io | |
- name: Assemble Sha Image | |
run: | | |
docker manifest create \ | |
'ghcr.io/getsentry/symbolicator:${{ github.sha }}' \ | |
'ghcr.io/getsentry/symbolicator:arm64-${{ github.sha }}' \ | |
'ghcr.io/getsentry/symbolicator:amd64-${{ github.sha }}' | |
docker manifest push ghcr.io/getsentry/symbolicator:${{ github.sha }} | |
- name: Assemble Latest Image | |
if: github.ref_name == 'master' | |
run: | | |
docker manifest create \ | |
'ghcr.io/getsentry/symbolicator:latest' \ | |
'ghcr.io/getsentry/symbolicator:arm64-${{ github.sha }}' \ | |
'ghcr.io/getsentry/symbolicator:amd64-${{ github.sha }}' | |
docker manifest push ghcr.io/getsentry/symbolicator:latest |