tests.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. paths:
  9. # Conservatively run the tests. However, skip them if the only paths in
  10. # the pull request match files that we know don't impact the build.
  11. - '**'
  12. - '!**/*.md'
  13. - '!LICENSE'
  14. - '!CODEOWNERS'
  15. - '!.git*'
  16. pull_request:
  17. paths:
  18. # Conservatively run the tests. However, skip them if the only paths in
  19. # the pull request match files that we know don't impact the build.
  20. - '**'
  21. - '!**/*.md'
  22. - '!LICENSE'
  23. - '!CODEOWNERS'
  24. - '!.git*'
  25. jobs:
  26. test:
  27. strategy:
  28. matrix:
  29. os: [ubuntu-latest, macos-latest]
  30. build_mode: [fastbuild, opt]
  31. runs-on: ${{ matrix.os }}
  32. steps:
  33. - name: Checkout
  34. uses: actions/checkout@v2
  35. with:
  36. submodules: true
  37. # Setup Python and related tools.
  38. - uses: actions/setup-python@v2
  39. with:
  40. python-version: '3.8.5'
  41. - name: Install python modules
  42. run: |
  43. pip install gql PyGitHub
  44. # On macOS we need Go and to use it to install Bazelisk.
  45. - uses: actions/setup-go@v2
  46. if: matrix.os == 'macos-latest'
  47. - name: Install bazelisk
  48. if: matrix.os == 'macos-latest'
  49. run: |
  50. go get github.com/bazelbuild/bazelisk
  51. echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
  52. # Print the various tool versions to help in debugging.
  53. - name: Print tool versions
  54. run: |
  55. bazelisk --version
  56. python --version
  57. echo gql "$(pip show gql | grep Version)"
  58. echo PyGitHub "$(pip show PyGitHub | grep Version)"
  59. # Build all targets first to isolate build failures.
  60. - name: Build (${{ matrix.build_mode }})
  61. run: |
  62. bazelisk build -c ${{ matrix.build_mode }} --verbose_failures \
  63. //...:all
  64. # Run all test targets.
  65. - name: Test (${{ matrix.build_mode }})
  66. run: |
  67. bazelisk test -c ${{ matrix.build_mode }} --test_output errors \
  68. --verbose_failures //...:all