diff --git a/.github/workflows/xls-modules.yml b/.github/workflows/xls-modules.yml new file mode 100644 index 00000000000..37e8a92a1a2 --- /dev/null +++ b/.github/workflows/xls-modules.yml @@ -0,0 +1,54 @@ +# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions +# See also: https://github.com/marketplace/actions/bazel-action + +name: Continuous Integration +on: + # Avoid triggering on pushes to /all/ open PR branches. + push: + branches: + - ci/dslx-dma-rebase-axi + paths-ignore: + # Do not trigger action when docs are updated. + - 'docs/**' + pull_request: + branches: + - main + # This lets us trigger manually from the UI. + workflow_dispatch: + +jobs: + build: + name: Bazel Build (opt) + runs-on: + labels: ubuntu-22.04-64core + timeout-minutes: 600 + steps: + - uses: actions/checkout@v2 + + - name: Mount Bazel Cache + uses: actions/cache@v3 + with: + path: "~/.cache/bazel" + # Create/use a cache called bazel-cache-22_04- + # and read the latest cache with prefix bazel-cache-22_04- + # if it doesn't already exist. + key: bazel-cache-22_04-${{ github.sha }} + restore-keys: bazel-cache-22_04- + + - name: Install dependencies via apt + run: sudo apt-get install python3-distutils python3-dev python-is-python3 libtinfo5 build-essential liblapack-dev libblas-dev gfortran + + - name: Install bazelisk + run: | + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64" + mkdir -p "${GITHUB_WORKSPACE}/bin/" + mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" + chmod +x "${GITHUB_WORKSPACE}/bin/bazel" + + - name: Bazel Build Tools (opt) + run: | + "${GITHUB_WORKSPACE}/bin/bazel" build -c opt --test_output=errors -- //xls/dslx:interpreter_main //xls/dslx/ir_convert:ir_converter_main //xls/tools:opt_main //xls/tools:codegen_main + + - name: Bazel Test All (opt) + run: | + "${GITHUB_WORKSPACE}/bin/bazel" test -c opt --test_output=errors -- //xls/...