Giter VIP home page Giter VIP logo

dodo-build's Introduction

build-test

Dodo Build Github Action

A GitHub Action to run Dodo, the Twitter OSS project builder.

Usage:

In your GitHub Actions workflow, create a "dodo-build" job which will run the builder. Then specify this job in the jobs.<job_id>.needs.

Note: it is best if this action is used with caches for maven (when publish-m2 is 'true'), ivy, and the Dodo Twitter OSS project builder state.

+++ .github/workflows/ci.yml
  name: CI
  on:
    push:
  jobs:
+   dodo-build:
+     runs-on: ubuntu-latest
+     steps:
+       - uses: actions/setup-java@v1
+         with:
+           java-version: 1.8
+       - name: cache/maven
+         uses: actions/cache@v1
+         with:
+           path: ~/.m2/repository
+           key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+           restore-keys: |
+             ${{ runner.os }}-maven-
+       - name: cache/ivy2-cache
+         uses: actions/cache@v1
+         with:
+           path: ~/.ivy2/cache
+           key: ${{ runner.os }}-sbt-ivy-cache-
+       - name: cache/ivy2-local
+         uses: actions/cache@v1
+         with:
+           path: ~/.ivy2/local/com.twitter
+           key: ${{ runner.os }}-sbt-ivy-local-
+       - name: cache/dodo
+         uses: actions/cache@v1
+         with:
+           path: ~/.dodo
+           key: ${{ runner.os }}-dodo-
+       - name: dodo/run
+         uses: twitter/dodo-build@v3
+         with:
+           project: scrooge
+           publish-m2: true
    test:
+     needs: dodo-build
      runs-on: ubuntu-latest

Options

Supports all of the main input options and projects as Dodo, the Twitter OSS project builder:

all             Build all projects in the DAG list (overrides --include). Default: false.
clean           Delete any sbt-launch.jar and run \"sbt clean\" before running other sbt commands.
                Default: false.
clean-files     Delete all $NAME caches, e.g., $DODO_DIRECTORY/caches, $DODO_DIRECTORY/clones, 
                and $DODO_DIRECTORY/builds. Default: false.
include         Include building of the given project. Default: false.
no-test         Do not run tests (will still compile tests via test:compile). 
                Default: false (run tests).
scala-version   If set, do not cross-compile instead use this specific version for building all projects.
                Default: unset (cross-compile).
clone-dir       Directory into which to clone remotes. Default: $HOME/.dodo/clones
local           Build source from local filesystem instead of Github. 
                Default: false (use Github sources).
branch          Branch to use when building from Github sources. Default: develop.
proxy           Base URL from which to resolve artifacts when working offline, (e.g., the sbt-launch.jar),
                Example: --proxy https://my.internal.company.repo/sbt-repo. NOTE: you MUST set 
                --local and --sbt-version with this option. Default: unset.
publish-m2      Also publish artifacts to the local ~/.m2 repository. Default: false.
sbt-version     The sbt version to use when downloading the sbt launch jar.
                Default: unset, the project defined sbt version will used.
dry-run         Output, but do not execute the sbt build commands. If using remotes
                they will still be cloned. Default: false.
verbose         Run in verbose mode. Default: false.
trace           Run in trace mode. Note: extremely verbose. Default: false.
project         [OPTIONAL] Individual project for which to build all dependencies. Optional if '--all' is passed. Required otherwise."

The only difference being in how to signal "toggle" options.

Most Dodo options are toggles (or switches). "On" or 'true' is denoted by adding the option, "off" or 'false' is denoted by exclusion or absence from the command line input.

With the dodo-build Github Action, to signal 'true', set the value of the desired key to 'true'. Setting the value to 'false', empty string, or using the default are all equivalent to setting 'false' for these Dodo options.

E.g.,

explicitly set to 'false':

uses: twitter/dodo-build@v3
with:
  project: scrooge
  verbose: false

set to empty string:

uses: twitter/dodo-build@v3
with:
  project: scrooge
  verbose: ''

do not include (uses default):

uses: twitter/dodo-build@v3
with:
  project: scrooge

All signal 'false' in this case for the verbose option. This is equivalent to running the Dodo script without the --verbose option.

Other options expect values and setting them with the dodo-build action is straightforward. Include the key with a value. Exclusion will result in the default value being used.

E.g.,

uses: twitter/dodo-build@v3
with:
  project: twitter-server
  branch: release

Lastly, the project option is special and is expected to be the value of a supported project for which to build dependencies. It is meant to be specified last when included. When using the dodo-build action, include the key with a value as shown the above examples.

dodo-build's People

Contributors

cacoco avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.