tests.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. name: test
  5. on:
  6. push:
  7. branches: [trunk]
  8. pull_request:
  9. jobs:
  10. test:
  11. strategy:
  12. matrix:
  13. os: [ubuntu-latest, macos-latest]
  14. build_mode: [fastbuild, opt]
  15. runs-on: ${{ matrix.os }}
  16. steps:
  17. - name: Checkout
  18. uses: actions/checkout@v2
  19. with:
  20. submodules: true
  21. # Setup Python and related tools.
  22. - uses: actions/setup-python@v2
  23. with:
  24. python-version: '3.8.5'
  25. - name: Install python modules
  26. run: |
  27. pip install gql PyGitHub
  28. # On macOS we need Go and to use it to install Bazelisk.
  29. - uses: actions/setup-go@v2
  30. if: matrix.os == 'macos-latest'
  31. - name: Install bazelisk
  32. if: matrix.os == 'macos-latest'
  33. run: |
  34. go get github.com/bazelbuild/bazelisk
  35. echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
  36. # Print the various tool versions to help in debugging.
  37. - name: Print tool versions
  38. run: |
  39. bazelisk --version
  40. python --version
  41. echo gql "$(pip show gql | grep Version)"
  42. echo PyGitHub "$(pip show PyGitHub | grep Version)"
  43. # Build all targets first to isolate build failures.
  44. - name: Build (${{ matrix.build_mode }})
  45. run: |
  46. bazelisk build -c ${{ matrix.build_mode }} --verbose_failures \
  47. //...:all
  48. # Run all test targets.
  49. - name: Test (${{ matrix.build_mode }})
  50. run: |
  51. bazelisk test -c ${{ matrix.build_mode }} --test_output errors \
  52. --verbose_failures //...:all