Skip to content

Commit

Permalink
Updating examples to use nativelink
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-singer authored and github-actions committed Jul 31, 2024
1 parent 386bfe5 commit 91b3287
Show file tree
Hide file tree
Showing 13 changed files with 178 additions and 344 deletions.
32 changes: 32 additions & 0 deletions .github/actions/build_example_nativelink/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build_example_nativelink
inputs:
NATIVELINK_ENGINE_ADDRESS_SECRET:
description: ''
required: true
NATIVELINK_AC_ADDRESS_SECRET:
description: ''
required: true
NATIVELINK_CAS_ADDRESS_SECRET:
description: ''
required: true
NATIVELINK_HEADER_RW_KEY_SECRET:
description: ''
required: true
runs:
using: composite
steps:
- name: Build examples/remote_execution/nativelink directory
run: |-
sed -i'' -e "s|NATIVELINK_ENGINE_ADDRESS|$NATIVELINK_ENGINE_ADDRESS|" \
-e "s|NATIVELINK_AC_ADDRESS|$NATIVELINK_AC_ADDRESS|" \
-e "s|NATIVELINK_CAS_ADDRESS|$NATIVELINK_CAS_ADDRESS|" \
-e "s|NATIVELINK_HEADER_RW_KEY|$NATIVELINK_HEADER_RW_KEY|" \
examples/remote_execution/nativelink/.buckconfig
cd examples/remote_execution/nativelink
$RUNNER_TEMP/artifacts/buck2 build //... -v 4
env:
NATIVELINK_ENGINE_ADDRESS: ${{ inputs.NATIVELINK_ENGINE_ADDRESS_SECRET }}
NATIVELINK_AC_ADDRESS: ${{ inputs.NATIVELINK_AC_ADDRESS_SECRET }}
NATIVELINK_CAS_ADDRESS: ${{ inputs.NATIVELINK_CAS_ADDRESS_SECRET }}
NATIVELINK_HEADER_RW_KEY: ${{ inputs.NATIVELINK_HEADER_RW_KEY_SECRET }}
shell: bash
25 changes: 24 additions & 1 deletion .github/actions/build_example_no_prelude/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
name: build_example_no_prelude
inputs:
NATIVELINK_ENGINE_ADDRESS_SECRET:
description: ''
required: true
NATIVELINK_AC_ADDRESS_SECRET:
description: ''
required: true
NATIVELINK_CAS_ADDRESS_SECRET:
description: ''
required: true
NATIVELINK_HEADER_RW_KEY_SECRET:
description: ''
required: true
runs:
using: composite
steps:
- name: Build example/no_prelude directory
run: |-
sed -i'' -e "s|NATIVELINK_ENGINE_ADDRESS|$NATIVELINK_ENGINE_ADDRESS|" \
-e "s|NATIVELINK_AC_ADDRESS|$NATIVELINK_AC_ADDRESS|" \
-e "s|NATIVELINK_CAS_ADDRESS|$NATIVELINK_CAS_ADDRESS|" \
-e "s|NATIVELINK_HEADER_RW_KEY|$NATIVELINK_HEADER_RW_KEY|" \
examples/no_prelude/.buckconfig
cd examples/no_prelude
$RUNNER_TEMP/artifacts/buck2 build //... -v 2
$RUNNER_TEMP/artifacts/buck2 build //... -v 4
env:
NATIVELINK_ENGINE_ADDRESS: ${{ inputs.NATIVELINK_ENGINE_ADDRESS_SECRET }}
NATIVELINK_AC_ADDRESS: ${{ inputs.NATIVELINK_AC_ADDRESS_SECRET }}
NATIVELINK_CAS_ADDRESS: ${{ inputs.NATIVELINK_CAS_ADDRESS_SECRET }}
NATIVELINK_HEADER_RW_KEY: ${{ inputs.NATIVELINK_HEADER_RW_KEY_SECRET }}
shell: bash
102 changes: 20 additions & 82 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,31 @@
name: Build and test
name: Build and test nativelink
on:
push:
pull_request:
workflow_dispatch:
workflow_call:
workflow_run:
workflows: ["rebase upstream manual", "rebase upstream cron"]
types:
- completed
jobs:
linux-build-and-test:
runs-on: 4-core-ubuntu
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/setup_linux_env
- uses: ./.github/actions/build_debug
- uses: ./.github/actions/run_test_py
macos-build-and-test:
runs-on: macos-latest
steps:
- uses: maxim-lobanov/[email protected]
with:
xcode-version: 15.3.0
- uses: actions/[email protected]
- uses: ./.github/actions/setup_macos_env
- uses: ./.github/actions/build_debug
- uses: ./.github/actions/run_test_py
windows-build-and-test:
runs-on: windows-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/setup_windows_env
- uses: ./.github/actions/build_debug
- uses: ./.github/actions/run_test_py
macos-build-examples:
runs-on: macos-latest
steps:
- uses: maxim-lobanov/[email protected]
with:
xcode-version: 15.3.0
- uses: actions/[email protected]
- uses: ./.github/actions/setup_macos_env
- uses: ./.github/actions/init_opam
- uses: ./.github/actions/build_release
- name: Setup the 'example/with_prelude' project
run: |-
cd examples/with_prelude
./haskell-setup.sh
./ocaml-setup.sh
- name: Build the 'example/with_prelude' project
run: |-
cd examples/with_prelude
$RUNNER_TEMP/artifacts/buck2 build //... -v 2
$RUNNER_TEMP/artifacts/buck2 test //... -v 2
- uses: ./.github/actions/build_example_no_prelude
- uses: ./.github/actions/setup_reindeer
- uses: ./.github/actions/build_bootstrap
linux-build-examples:
runs-on: ubuntu-latest
runs-on: xlarge-ubuntu-x86-22.04
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/setup_linux_env
- uses: ./.github/actions/init_opam
- uses: ./.github/actions/build_release
- name: Setup the 'example/with_prelude' project
run: |-
cd examples/with_prelude
./haskell-setup.sh
./ocaml-setup.sh
- name: Build the 'example/with_prelude' project
run: |-
cd examples/with_prelude
$RUNNER_TEMP/artifacts/buck2 build //... -v 2
$RUNNER_TEMP/artifacts/buck2 test //... -v 2
- uses: ./.github/actions/build_example_conan
- uses: ./.github/actions/build_debug
- uses: ./.github/actions/build_example_nativelink
with:
NATIVELINK_ENGINE_ADDRESS_SECRET: ${{ secrets.NATIVELINK_ENGINE_ADDRESS_SECRET }}
NATIVELINK_AC_ADDRESS_SECRET: ${{ secrets.NATIVELINK_AC_ADDRESS_SECRET }}
NATIVELINK_CAS_ADDRESS_SECRET: ${{ secrets.NATIVELINK_CAS_ADDRESS_SECRET }}
NATIVELINK_HEADER_RW_KEY_SECRET: ${{ secrets.NATIVELINK_HEADER_RW_KEY_SECRET }}
- uses: ./.github/actions/build_example_no_prelude
with:
NATIVELINK_ENGINE_ADDRESS_SECRET: ${{ secrets.NATIVELINK_ENGINE_ADDRESS_SECRET }}
NATIVELINK_AC_ADDRESS_SECRET: ${{ secrets.NATIVELINK_AC_ADDRESS_SECRET }}
NATIVELINK_CAS_ADDRESS_SECRET: ${{ secrets.NATIVELINK_CAS_ADDRESS_SECRET }}
NATIVELINK_HEADER_RW_KEY_SECRET: ${{ secrets.NATIVELINK_HEADER_RW_KEY_SECRET }}
- uses: ./.github/actions/setup_reindeer
- uses: ./.github/actions/build_bootstrap
windows-build-examples:
runs-on: windows-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/setup_windows_env
- uses: ./.github/actions/build_release
- name: Build example/prelude directory
run: |-
cd examples/with_prelude
& $Env:RUNNER_TEMP/artifacts/buck2 build //... -v 2
& $Env:RUNNER_TEMP/artifacts/buck2 test //... -v 2
- uses: ./.github/actions/build_example_no_prelude
- name: Configure CARGO_HOME
run: |-
echo CARGO_HOME=$GITHUB_WORKSPACE/.cargo >> $GITHUB_ENV
echo $GITHUB_WORKSPACE/.cargo/bin >> $GITHUB_PATH
shell:
bash
- uses: ./.github/actions/setup_reindeer
- uses: ./.github/actions/build_bootstrap
24 changes: 24 additions & 0 deletions .github/workflows/rebase-upstream-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: rebase upstream cron
on:
schedule:
- cron: '*/180 * * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Rebase
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git remote add upstream http://github.com/facebook/buck2.git
git fetch upstream
git rebase upstream/main
- name: Push changes
uses: ad-m/github-push-action@master
with:
force_with_lease: true
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
22 changes: 22 additions & 0 deletions .github/workflows/rebase-upstream-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: rebase upstream manual
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Rebase
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git remote add upstream http://github.com/facebook/buck2.git
git fetch upstream
git rebase upstream/main
- name: Push changes
uses: ad-m/github-push-action@master
with:
force_with_lease: true
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
Loading

0 comments on commit 91b3287

Please sign in to comment.