Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Secure reusable build infrastructure

License

NotificationsYou must be signed in to change notification settings

elide-dev/build-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lint: ActionsLint: YAMLOpenSSF Best Practices

Structure

Each workflow profile is defined in this repository as a GitHub Workflow, using YAML. In some cases, workflows are pairedwith a container image which includes the tools which are used by the workflow. The image typically isn't required (unlessnoted) but may vastly speed up builds by pre-including tools.

For an exhaustive list of build profiles and their use, see the table further down.

  • Containers: Container image definitions which are used byactions andworkflows; some ofthese can also be used directly in downstream workflows.

  • Actions: Custom GitHub Actions for use in Elide codebases. Actions are used like any other GitHub Action,but with references to this repository instead.

  • Workflows: Custom YAML workflow definitions for use in Elide codebases. Workflows are used as externalworkflow_call targets.

  • Gradle: Gradle build conventions which are re-usable across projects, as a suite of easily applicable build conventionplugins and version catalogs.

Workflows

In a.github/workflows/<x>.yml:

# ...jobs:## Build containerbuild-a-container:name:"Image"uses:elide-dev/build-infra/.github/workflows/container.yml@mainsecrets:inheritpermissions:checks:writeid-token:writecontents:readpackages:writepull-requests:writewith:image:elide-dev/build-infra/gvmpath:containers/gvmpush:${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

The above job uses thecontainer.yml "build profile" (see all profiles listed below). By using the re-usable workflow, yougain consistency:

  • Repository authentication is handled for you
  • Intelligent platform selection (with override)
  • Consistent tagging and labeling of images
  • Underlying Github Actions updates happen without repo commits

Build profiles

NameDescription
android.ymlBuild an Android app with Gradle
container.ymlBuild and push a container image
jvm.gradle.ymlRun a Gradle build targeting JVM
jvm.maven.ymlRun a Maven build targeting JVM
bazel.ymlBuild targets with Bazel

See below for documentation about reusable workflow inputs.

Workflow inputs

See below for an exhaustive list of all inputs for each build profile. You can use these inputs in thewith: {} block of your workflow invocation.

Containers

  • Description: Consistently build properly tagged container images in sync with source control
  • Workflow:.github/workflows/container.yml

Inputs

NameTypeDescriptionDefault value
image*stringImage coordinate to build(None. Required.)
authbooleanWhether to authenticatetrue
dockerfilestringFull path to Dockerfile to build"Dockerfile"
pathstringDocker context path for build"."
platformsstringArchitectures/platforms to build"linux/amd64,linux/arm64"
pushbooleanWhether to push after buildingfalse
registrystringWhether to push after building"ghcr.io"
runnerstringRunner to use for all tasks(See runner docs)
tagsstringTags to push to with built image(None.)

Gradle: Android

  • Description: Consistently build JVM outputs using Gradle
  • Workflow:.github/workflows/jvm.gradle.yml

Inputs

NameTypeDescriptionDefault value
actionstringGradle task(s) to execute"build"
androidbooleanInstall Android SDKtrue
artifactstringName of output artifact to use(None.)
artifactsbooleanUpload built artifactsfalse
cache_actionbooleanTurn GHA cache on/offtrue
cache_localbooleanTurn local caching on/offfalse
cache_read_onlybooleanGHA cache read-only statusfalse
cache_remotebooleanTurn remote caching on/offtrue
checksbooleanRun checks and Sonartrue
coveragebooleanUpload → Codecov after buildfalse
coverage_reportstringPath to coverage report(None.)
coverage_flagsstringExtra flags to pass to Codecov(None.)
flagsstringExtra flags to append(None.)
gradlestringGradle version to install & use"wrapper"
install_jvmbooleanSetup a regular JVM before buildtrue
jvmstringJVM version to install/target(See JVM notes below)
jvm_diststringJVM distribution to use"adopt-hotspot"
labelstringLabel to show for build step"Gradle"
reportsbooleanWhether to upload built reportstrue
runnerstringRunner to use for all tasks(See runner docs)

Gradle: JVM

  • Description: Consistently build JVM outputs using Gradle
  • Workflow:.github/workflows/jvm.gradle.yml

Inputs

NameTypeDescriptionDefault value
actionstringGradle task(s) to execute"build"
artifactstringName of output artifact to use(None.)
artifactsbooleanUpload built artifactsfalse
cache_actionbooleanTurn GHA cache on/offtrue
cache_localbooleanTurn local caching on/offfalse
cache_read_onlybooleanGHA cache read-only statusfalse
cache_remotebooleanTurn remote caching on/offtrue
checksbooleanRun checks and Sonartrue
coveragebooleanUpload → Codecov after buildfalse
coverage_reportstringPath to coverage report(None.)
coverage_flagsstringExtra flags to pass to Codecov(None.)
flagsstringExtra flags to append(None.)
gradlestringGradle version to install & use"wrapper"
gvmstringGraalVM version to use(See JVM notes below)
gvm_componentsstringGraalVM components to install"native-image,js"
install_gvmbooleanSetup a distribution of GraalVMfalse
install_jvmbooleanSetup a regular JVM before buildtrue
jvmstringJVM version to install/target(See JVM notes below)
jvm_diststringJVM distribution to use"adopt-hotspot"
labelstringLabel to show for build step"Gradle"
provenancebooleanStamp for SLSA provenancefalse
publishbooleanPerform a publish after buildfalse
reportsbooleanWhether to upload built reportstrue
runnerstringRunner to use for all tasks(See runner docs)

JVM: Maven

  • Description: Consistently build JVM outputs using Maven
  • Workflow:.github/workflows/jvm.maven.yml

Inputs

Inputs for the Maven workflow are nearly identical to those for the Gradle workflow (listed above):

NameTypeDescriptionDefault value
actionstringMaven goal(s) to execute"package"
artifactstringName of output artifact to use(None.)
artifactsbooleanUpload built artifactsfalse
cache_actionbooleanTurn GHA cache on/offtrue
cache_localbooleanTurn local caching on/offfalse
cache_read_onlybooleanGHA cache read-only statusfalse
cache_remotebooleanTurn remote caching on/offtrue
checksbooleanRun checks and Sonartrue
coveragebooleanUpload → Codecov after buildfalse
coverage_reportstringPath to coverage report(None.)
coverage_flagsstringExtra flags to pass to Codecov(None.)
flagsstringExtra flags to append(None.)
gvmstringGraalVM version to use(See JVM notes below)
gvm_componentsstringGraalVM components to install"native-image,js"
install_gvmbooleanSetup a distribution of GraalVMfalse
install_jvmbooleanSetup a regular JVM before buildtrue
jvmstringJVM version to install/target(See JVM notes below)
jvm_diststringJVM distribution to use"adopt-hotspot"
labelstringLabel to show for build step"Gradle"
provenancebooleanStamp for SLSA provenancefalse
publishbooleanPerform a publish after buildfalse
reportsbooleanWhether to upload built reportstrue
runnerstringRunner to use for all tasks(See runner docs)

Bazel

  • Description: Run builds with Bazel
  • Workflow:.github/workflows/bazel.yml

Inputs

There are no required inputs for a Bazel build; the target specification defaults to the value//..., which builds all targets. The defaultcommand isbuild. The build is executed withBazelisk, which will respect the.bazelversion present at the root of your project.

NameTypeDescriptionDefault value
artifactstringName of output artifact to use(None.)
artifactsbooleanUpload built artifactsfalse
cache_actionbooleanTurn GHA cache on/offtrue
commandstringBazel command to execute"build"
targetsstringBazel target string"//..."
flagsstringExtra flags to append(None.)
gvmstringGraalVM version to use(See JVM notes below)
gvm_componentsstringGraalVM components to install"native-image,js"
install_gvmbooleanSetup a distribution of GraalVMfalse
install_jvmbooleanSetup a regular JVM before buildtrue
jvmstringJVM version to install/target(See JVM notes below)
jvm_diststringJVM distribution to use"adopt-hotspot"
runnerstringRunner to use for all tasks(See runner docs)

Gradle Conventions

The Gradle conventions provided by this project are generic in nature and can be used in nearly any Gradle 8+ project.Conventions are applied in a cascading fashion, with relevant plugins being applied first, which then provide strongbaseline settings.

Gradle infra:

  • Plugins for common build tasks, especially aroundJPMS. See the plugins list below.
  • Catalogs defining security-hardened library catalogs
  • Platforms which enforce different profiles of dependency constraints

Read more about the Gradle build infrahere. There aresamples.

Plugins

  • dev.elide.gha: Integrate your Gradle build with GitHub Actions. Enables enhanced logging and reportingfeatures, PR integrations, and other features supported by the workflows in this repo.

  • dev.elide.jmod: Buildjmod artifacts in Gradle JVM projects with Java 9+.jmod artifacts arecompatible withjlink and make for great optimized build artifacts in modular projects.

  • dev.elide.jpms: Toolkit plugin for Gradle builds enabled with modular Java (Java Platform Module System, orJPMS). Provides amodulepath configuration and modular builds for Java, Kotlin, and GraalVM.

  • dev.elide.mrjar: Plugin for easily building multi-target MRJAR artifacts. This plugin goes above and beyondby building the entire project at each bytecode tier, so that modern Java runtimes can leverage the latest bytecode.

  • dev.elide.jlink: Plugin for usingjmod andjpms to build optimized, self-contained modular Java appsusingjlink.

  • dev.elide.graalvm: Plugin for usingjmod andjpms to build optimized, native AOT Java apps usingnative-image.

Contributing

Follow the YAML and action convention within the repository; the multi-workspace expressed here for actions uses theGitHub Actions Toolkit andpnpmworkspaces.

Build configurations are validated on each push, and actions are built and tested to the extent possible. Once a PR is merged,it is expected to be deployed to private package storage, where update tools can pick it up.

License

This repository is shared openly for OSS use. It is licensed as MIT.


[8]ページ先頭

©2009-2025 Movatter.jp