ci: unify installation testing into a single matrix #164
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: packaging | |
| concurrency: | |
| group: "${{github.workflow}}-${{github.ref}}" | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - v4.x | |
| tags: | |
| - v*.*.* | |
| pull_request: | |
| types: [opened, synchronize] | |
| branches: | |
| - '*' | |
| jobs: | |
| package: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - "ruby" | |
| - "aarch64-linux-gnu" | |
| - "aarch64-linux-musl" | |
| - "arm64-darwin" | |
| - "x64-mingw-ucrt" | |
| - "x64-mingw32" | |
| - "x86_64-darwin" | |
| - "x86_64-linux-gnu" | |
| - "x86_64-linux-musl" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: rm Gemfile.lock | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.2" | |
| bundler: latest | |
| bundler-cache: true | |
| - run: "bundle exec rake gem:${{matrix.platform}}" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: gem-${{matrix.platform}} | |
| path: pkg | |
| retention-days: 1 | |
| vanilla-install: | |
| needs: ["package"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.2" | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: gem-ruby | |
| path: pkg | |
| - run: "gem install pkg/tailwindcss-ruby-*.gem" | |
| - run: "tailwindcss 2>&1 | fgrep 'ERROR: Cannot find the tailwindcss executable'" | |
| install-matrix: | |
| name: install-${{ matrix.platform }} | |
| needs: [ "package" ] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby: [ "3.4" ] | |
| platform: | |
| - "aarch64-linux-gnu" | |
| - "aarch64-linux-musl" | |
| - "arm64-darwin" | |
| - "x64-mingw-ucrt" | |
| - "x64-mingw32" | |
| - "x86_64-darwin" | |
| - "x86_64-linux-gnu" | |
| - "x86_64-linux-musl" | |
| include: | |
| - { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64/v8" } | |
| - { platform: aarch64-linux-musl, docker_tag: "-alpine", docker_platform: "--platform=linux/arm64/v8" } | |
| - { platform: arm64-darwin, runs-on: macos-14 } | |
| - { platform: x64-mingw-ucrt, runs-on: windows-latest } | |
| - { platform: x64-mingw32, runs-on: windows-latest, ruby: "3.0" } | |
| - { platform: x86_64-darwin, runs-on: macos-13 } | |
| - { platform: x86_64-linux-musl, docker_tag: "-alpine" } | |
| runs-on: ${{ matrix.runs_on || 'ubuntu-latest' }} | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: gem-${{ matrix.platform }} | |
| path: pkg | |
| - if: ${{ matrix.runs_on }} | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| - if: ${{ matrix.runs_on }} | |
| run: "gem install pkg/tailwindcss-ruby-*.gem" | |
| - if: ${{ matrix.runs_on }} | |
| run: "tailwindcss --help" | |
| - if: ${{ (! matrix.runs_on) && matrix.docker_platform }} | |
| run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
| - if: ${{ ! matrix.runs_on }} | |
| run: | |
| docker run --rm -v $PWD:/tailwindcss-ruby -w /tailwindcss-ruby \ | |
| ${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag}} \ | |
| sh -c " | |
| gem install pkg/tailwindcss-ruby-*.gem | |
| tailwindcss --help | |
| " |