Skip to content

Instantly share code, notes, and snippets.

@zacker330
Created March 26, 2022 21:54
Show Gist options
  • Save zacker330/c46b873e64b4dad32cfca952d9fb9893 to your computer and use it in GitHub Desktop.
Save zacker330/c46b873e64b4dad32cfca952d9fb9893 to your computer and use it in GitHub Desktop.

Revisions

  1. zacker330 created this gist Mar 26, 2022.
    41 changes: 41 additions & 0 deletions build.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    # This workflow will build a Java project with Maven
    # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

    name: pipeline

    on:
    push:
    branches: [ master ]
    pull_request:
    branches: [ master ]

    jobs:
    build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set env
    run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-10)" >> $GITHUB_ENV
    - name: Test
    run: echo $GITHUB_SHA_SHORT
    - name: Set up JDK 11
    uses: actions/setup-java@v2
    with:
    java-version: '11'
    distribution: 'adopt'
    - name: Mount bazel cache
    uses: actions/cache@v1
    with:
    path: "/home/runner/.cache/bazel"
    key: bazel

    - name: Install bazelisk
    run: |
    curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
    mkdir -p "${GITHUB_WORKSPACE}/bin/"
    mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
    chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
    - name: Build
    run: |
    "${GITHUB_WORKSPACE}/bin/bazel" build //...