Dev builds - Sarath #4
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: Dev builds - Sarath | |
on: | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
env: | |
GO_VERSION: "1.21.11" | |
jobs: | |
get-version: | |
name: Get application version for this revision | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get version | |
id: get-version | |
run: | | |
TAG=$(git describe --tags --abbrev=5 --match "v[0-9]*") | |
echo "version=${TAG/v}" > $GITHUB_OUTPUT | |
- name: Print version | |
run: echo ::notice title=Version::${{ steps.get-version.outputs.version }} | |
# Add lint to dev builds as that's the only way for cache to be shared across branches. | |
# https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key | |
lint: | |
name: Lint (golangci-lint) | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
arch_os: ["linux_amd64"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: false | |
- name: Get GOCACHE and GOMODCACHE | |
run: | | |
echo "GOMODCACHE=$(go env GOMODCACHE)" >> "$GITHUB_ENV" | |
echo "GOCACHE=$(go env GOCACHE)" >> "$GITHUB_ENV" | |
- uses: actions/cache/restore@v4 | |
with: | |
path: | | |
${{ env.GOMODCACHE }}/cache | |
${{ env.GOCACHE }} | |
key: go-test-${{ env.GO_VERSION }}-${{matrix.arch_os}}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }} | |
restore-keys: | | |
go-test-${{ env.GO_VERSION }}-${{matrix.arch_os}}- | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
/home/runner/.cache/golangci-lint | |
key: golangci-lint-${{ env.GO_VERSION }}-${{matrix.arch_os}}-${{ hashFiles('pkg/**/go.sum', 'otelcolbuilder/.otelcol-builder.yaml') }} | |
restore-keys: | | |
golangci-lint-${{ env.GO_VERSION }}-${{matrix.arch_os}}- | |
- name: Install golangci-lint | |
run: make install-golangci-lint | |
- name: Add opentelemetry-collector-builder installation dir to PATH | |
run: echo "$HOME/bin" >> $GITHUB_PATH | |
- name: Run golangci-lint | |
run: make golint | |
test: | |
name: Test | |
uses: ./.github/workflows/workflow-test.yml | |
strategy: | |
matrix: | |
include: | |
- arch_os: darwin_amd64 | |
runs-on: macos-latest | |
with: | |
arch_os: ${{ matrix.arch_os }} | |
runs-on: ${{ matrix.runs-on }} | |
save-cache: true | |
boringcrypto: ${{ matrix.boringcrypto == true }} | |
test-otelcol-config: | |
name: Test (otelcol-config) | |
uses: ./.github/workflows/workflow-test-otelcol-config.yml | |
strategy: | |
matrix: | |
include: | |
- arch_os: darwin_amd64 | |
runs-on: macos-latest | |
with: | |
arch_os: ${{ matrix.arch_os }} | |
runs-on: ${{ matrix.runs-on }} | |
save-cache: true | |
boringcrypto: ${{ matrix.boringcrypto == true }} | |
build: | |
name: Build | |
uses: ./.github/workflows/workflow-build.yml | |
# needs: [get-version] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch_os: darwin_amd64 | |
runs-on: macos-latest | |
- arch_os: darwin_arm64 | |
runs-on: macos-latest | |
with: | |
arch_os: ${{ matrix.arch_os }} | |
runs-on: ${{ matrix.runs-on }} | |
fips: ${{ matrix.fips == true }} | |
save-cache: true | |
sumo_component_gomod_version: "v0.102.1-sumo-0-rc.0-2-gb78a7" | |
secrets: | |
apple_developer_certificate_p12_base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} | |
apple_developer_certificate_password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} | |
app_store_connect_password: ${{ secrets.AC_PASSWORD }} | |
microsoft_certificate: ${{ secrets.MICROSOFT_CERTIFICATE }} | |
microsoft_certificate_password: ${{ secrets.MICROSOFT_CERTIFICATE_PASSWORD }} | |
microsoft_certificate_hash: ${{ secrets.MICROSOFT_CERTHASH }} | |
microsoft_certificate_name: ${{ secrets.MICROSOFT_CERTNAME }} | |
microsoft_description: ${{ secrets.MICROSOFT_DESCRIPTION }} | |
build-otelcol-config: | |
name: Build (otelcol-config) | |
uses: ./.github/workflows/workflow-build-otelcol-config.yml | |
needs: [get-version] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- arch_os: darwin_amd64 | |
runs-on: macos-latest | |
- arch_os: darwin_arm64 | |
runs-on: macos-latest | |
- arch_os: linux_amd64 | |
runs-on: ubuntu-20.04 | |
- arch_os: linux_amd64 | |
runs-on: ubuntu-20.04 | |
fips: true | |
- arch_os: linux_arm64 | |
runs-on: ubuntu-20.04 | |
- arch_os: linux_arm64 | |
runs-on: ubuntu-20.04 | |
fips: true | |
with: | |
arch_os: ${{ matrix.arch_os }} | |
runs-on: ${{ matrix.runs-on }} | |
fips: ${{ matrix.fips == true }} | |
save-cache: true | |
sumo_component_gomod_version: "v${{ needs.get-version.outputs.version }}" | |
secrets: | |
apple_developer_certificate_p12_base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} | |
apple_developer_certificate_password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} | |
app_store_connect_password: ${{ secrets.AC_PASSWORD }} |