Skip to content

Builder for Swift projects that support WebAssembly

Actions
This action has SwiftWasm toolchain, SDK and developer tools preinstalled for your CI needs
v5.9
Latest
Star (18)

Warning

Deprecated: This Action is no longer necessary. Please use swiftwasm/setup-swiftwasm and carton version 1.0.0 or later.

See pointfreeco/swift-custom-dump#113 as an example of migration

SwiftWasm GitHub Action

This action builds your project with the SwiftWasm toolchain and SDK, and has carton and its WebAssembly dependencies preinstalled.

Inputs

shell-action

Optional The shell command to run on your project. Default is carton test.

Example usage

name: Build and test with SwiftWasm

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  swiftwasm_build:
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v3
      - uses: swiftwasm/[email protected]
        with:
          shell-action: carton test

Usage with GitHub Pages

GitHub Pages is an easy way to host SwiftWasm apps. Follow the GitHub Pages guide, and then use an appropriate action after running carton bundle to publish the results:

name: Deploy to GitHub Pages

on:
  push:
    branches: [main]

jobs:
  swiftwasm_deploy:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v3

      - uses: swiftwasm/[email protected]
        with:
          shell-action: carton bundle
      - uses: actions/upload-pages-artifact@v1
        with:
          path: ./Bundle

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - id: deployment
        uses: actions/deploy-pages@v2

Builder for Swift projects that support WebAssembly is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

This action has SwiftWasm toolchain, SDK and developer tools preinstalled for your CI needs
v5.9
Latest

Builder for Swift projects that support WebAssembly is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.