diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 187fd2ad9d..64a15f4f24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,50 +41,36 @@ jobs: brew install hadolint hadolint Dockerfile - brew-tests: + tests: + name: ${{ matrix.name }} needs: syntax - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: include: - - test-flags: --no-compat --online - - test-flags: --generic --online - - test-flags: --online - steps: - - name: Set up Homebrew - id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master - - - name: Cache Bundler RubyGems - uses: actions/cache@v1 - with: - path: ${{ steps.set-up-homebrew.outputs.gems-path }} - key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} - restore-keys: ${{ runner.os }}-rubygems- - - - run: brew install-bundler-gems - - - name: Run brew tests - run: | - # brew tests doesn't like world writable directories - sudo chmod -R g-w,o-w /home/linuxbrew/.linuxbrew/Homebrew - - brew tests ${{ matrix.test_flags }} - env: - HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - brew-tests-coverage: - needs: syntax - runs-on: macos-11.0 + - name: 'tests (no compatibility)' + os: ubuntu-latest + test-flags: --no-compat --online + - name: 'tests (generic OS)' + os: ubuntu-latest + test-flags: --generic --online + - name: tests (Linux) + os: ubuntu-latest + test-flags: --online + - name: tests (macOS) + os: macos-11.0 + test-flags: --online --coverage steps: - name: Set up Homebrew id: set-up-homebrew uses: Homebrew/actions/setup-homebrew@master - name: Set up Xcode + if: matrix.os == 'macos-11.0' run: sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer - name: Install brew tests dependencies + if: runner.os == 'macOS' run: | brew install subversion Library/Homebrew/shims/scm/svn --homebrew=print-path @@ -100,24 +86,30 @@ jobs: - run: brew install-bundler-gems - - run: brew tests --online --coverage + - name: Run brew tests + run: | + if ${{ runner.os == 'Linux' }}; then + # brew tests doesn't like world writable directories + sudo chmod -R g-w,o-w /home/linuxbrew/.linuxbrew/Homebrew + fi + + if ${{ runner.os == 'macOS' }}; then + # Set variables for coverage reporting. + export HOMEBREW_CODECOV_TOKEN='3ea0364c-80ce-47a3-9fba-93a940d4b5d7' + + # These cannot be queried at the macOS level on GitHub Actions. + export HOMEBREW_LANGUAGES='en-GB' + fi + + brew tests ${{ matrix.test-flags }} env: HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # set variables for coverage reporting - HOMEBREW_CODECOV_TOKEN: 3ea0364c-80ce-47a3-9fba-93a940d4b5d7 - - # These cannot be queried at the macOS level on GitHub Actions. - HOMEBREW_LANGUAGES: en-GB - more-tests-and-syntax: needs: syntax runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - - macos-11.0 include: - os: ubuntu-latest core-tap: "linuxbrew-core"