Merge pull request #2 from olivermt/ash-cms-source-extraction-pr #61
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| wasm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.16.0 | |
| - name: Build WASM | |
| run: zig build -Dtarget=wasm32-freestanding -Doptimize=ReleaseSmall | |
| - name: Verify WASM output | |
| run: test -f zig-out/bin/tailwind_compiler.wasm | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: tailwind_compiler.wasm | |
| path: zig-out/bin/tailwind_compiler.wasm | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| - os: ubuntu-24.04-arm | |
| - os: macos-latest | |
| - os: windows-latest | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.16.0 | |
| - name: Build Zig library | |
| run: zig build -Doptimize=ReleaseFast | |
| - name: Run Zig tests | |
| run: zig build test | |
| # Some hosted runners report ImageOS strings that setup-beam doesn't | |
| # recognize (e.g. ubuntu24-arm64, win25-vs2026). Override ImageOS to a value | |
| # the action knows; the architecture is detected separately from the runner. | |
| - name: Set up Erlang/Elixir (ARM) | |
| if: matrix.os == 'ubuntu-24.04-arm' | |
| uses: erlef/setup-beam@v1 | |
| env: | |
| ImageOS: ubuntu24 | |
| with: | |
| otp-version: "27" | |
| elixir-version: "1.17" | |
| - name: Set up Erlang/Elixir (Windows) | |
| if: matrix.os == 'windows-latest' | |
| uses: erlef/setup-beam@v1 | |
| env: | |
| ImageOS: win25 | |
| with: | |
| otp-version: "27" | |
| elixir-version: "1.17" | |
| - name: Set up Erlang/Elixir | |
| if: matrix.os != 'ubuntu-24.04-arm' && matrix.os != 'windows-latest' | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: "27" | |
| elixir-version: "1.17" | |
| - name: Install Elixir deps | |
| run: | | |
| mix local.hex --force | |
| mix local.rebar --force | |
| mix deps.get | |
| - name: Fix Zigler Windows NIF headers | |
| if: runner.os == 'Windows' | |
| run: | | |
| mkdir -p deps/zigler/priv/erl_nif_win | |
| curl -sL "https://raw.githubusercontent.com/bcardarella/zigler/main/priv/erl_nif_win/erl_nif_win.h" \ | |
| -o deps/zigler/priv/erl_nif_win/erl_nif_win.h | |
| curl -sL "https://raw.githubusercontent.com/bcardarella/zigler/main/priv/erl_nif_win/erl_nif_api_funcs_win.h" \ | |
| -o deps/zigler/priv/erl_nif_win/erl_nif_api_funcs_win.h | |
| - name: Run Elixir tests | |
| env: | |
| TAILWIND_COMPILER_PATH: "true" | |
| run: mix test | |
| pages: | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: wasm | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: tailwind_compiler.wasm | |
| path: wasm-demo/ | |
| - uses: actions/configure-pages@v5 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: wasm-demo/ | |
| - id: deploy | |
| uses: actions/deploy-pages@v4 |