Skip to content

Commit

Permalink
Merge branch 'main' into chore/allow-manual-blackduck-trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobmoellerdev authored Nov 19, 2024
2 parents 5b14c15 + fb23e41 commit 629988c
Show file tree
Hide file tree
Showing 150 changed files with 4,026 additions and 1,330 deletions.
3 changes: 3 additions & 0 deletions .github/config/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ linters:
# Disabled because of deprecation
- execinquery

# Seriously, who wants every comment to end in a period???
- godot

linters-settings:
gci:
sections:
Expand Down
15 changes: 3 additions & 12 deletions .github/config/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# However, latest builds (equivalent to nightlies based on the main branch), uses latest.yml
version: 2

release:
prerelease: auto

before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -90,18 +93,6 @@ changelog:
- '^docs:'
- '^test:'

brews:
- name: ocm
repository:
owner: open-component-model
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
directory: Formula
homepage: "https://ocm.software/"
description: "The OCM CLI makes it easy to create component versions and embed them in build processes."
test: |
system "#{bin}/ocm --version"
nfpms:
- id: debian
package_name: ocm-cli
Expand Down
1 change: 1 addition & 0 deletions .github/config/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ repocpi
repositoryimpl
repositoryspec
resendbuffer
resmgmt
resolvers
resourcereference
routings
Expand Down
3 changes: 3 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ exclude-labels:
- 'triage/wont-fix'
- 'triage/invalid'
categories:
- title: '‼️ Breaking Changes'
labels:
- 'breaking-change'
- title: '🚀 Features'
labels:
- 'kind/enhancement'
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/blackduck_scan_scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,28 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: '${{ github.workspace }}/go.mod'
cache: false

- name: Get go environment for use with cache
run: |
echo "go_cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "go_modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
# This step will only reuse the go mod and build cache from main made during the Build,
# see push_ocm.yaml => "ocm-cli-latest" Job
# This means it never caches by itself and PRs cannot cause cache pollution / thrashing
# This is because we have huge storage requirements for our cache because of the mass of dependencies
- name: Restore / Reuse Cache from central build
id: cache-golang-restore
uses: actions/cache/restore@v4 # Only Restore, not build another cache (too big)
with:
path: |
${{ env.go_cache }}
${{ env.go_modcache }}
key: ${{ env.cache_name }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ env.cache_name }}-${{ runner.os }}-go-
env:
cache_name: ocm-cli-latest-go-cache # needs to be the same key in the end as in the build step

- name: Blackduck Full Scan
uses: mercedesbenzio/detect-action@v2
Expand Down
69 changes: 0 additions & 69 deletions .github/workflows/buildcomponents.yaml

This file was deleted.

13 changes: 9 additions & 4 deletions .github/workflows/check_diff_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ jobs:
run: |
echo "go_cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "go_modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: Set up cache
# https://github.com/actions/setup-go/issues/358 - cache is not working with setup-go for multiple jobs
uses: actions/cache@v4
# This step will only reuse the go mod and build cache from main made during the Build,
# see lint_and_test.yaml => "test" Job
# This means it never caches by itself and PRs cannot cause cache pollution / thrashing
# This is because we have huge storage requirements for our cache because of the mass of dependencies
- name: Restore / Reuse Cache from central build
id: cache-golang-restore
uses: actions/cache/restore@v4 # Only Restore, not build another cache (too big)
with:
path: |
${{ env.go_cache }}
Expand All @@ -32,7 +37,7 @@ jobs:
restore-keys: |
${{ env.cache_name }}-${{ runner.os }}-go-
env:
cache_name: diff-check-go-cache
cache_name: run-tests-go-cache # needs to be the same key in the end as in the build step

- name: Make generate and deepcopy
run: |
Expand Down
56 changes: 39 additions & 17 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
# - ADDENDUM: We moved this to a larger runner for faster analysis
runs-on: large_runner
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
Expand All @@ -45,7 +46,7 @@ jobs:
matrix:
include:
- language: go
build-mode: autobuild
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
Expand All @@ -61,7 +62,39 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.

- name: Setup Go
uses: actions/setup-go@v5
if: matrix.build-mode == 'manual'
with:
go-version-file: '${{ github.workspace }}/go.mod'
cache: false

- name: Get go environment for use with cache
if: matrix.build-mode == 'manual'
run: |
echo "go_cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "go_modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
# This step will only reuse the go mod and build cache from main made during the Build,
# see push_ocm.yaml => "ocm-cli-latest" Job
# This means it never caches by itself and PRs cannot cause cache pollution / thrashing
# This is because we have huge storage requirements for our cache because of the mass of dependencies
- name: Restore / Reuse Cache from central build
if: matrix.build-mode == 'manual'
id: cache-golang-restore
uses: actions/cache/restore@v4 # Only Restore, not build another cache (too big)
with:
path: |
${{ env.go_cache }}
${{ env.go_modcache }}
key: ${{ env.cache_name }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ env.cache_name }}-${{ runner.os }}-go-
env:
cache_name: ocm-cli-latest-go-cache # needs to be the same key in the end as in the build step

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand All @@ -74,20 +107,9 @@ jobs:
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Build
if: matrix.build-mode == 'manual'
run: make build -j

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
Loading

0 comments on commit 629988c

Please sign in to comment.