{"id":16568536,"url":"https://github.com/matejkob/swift-macro-compatibility-check","last_synced_at":"2025-04-13T06:31:18.384Z","repository":{"id":246689226,"uuid":"821853854","full_name":"Matejkob/swift-macro-compatibility-check","owner":"Matejkob","description":"GitHub Action that verifies compatibility of a Swift package with macros against all swift-syntax versions","archived":false,"fork":false,"pushed_at":"2024-09-27T19:11:22.000Z","size":41,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T23:29:40.800Z","etag":null,"topics":["ci-cd","swift","testing","xcode"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Matejkob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-29T16:16:39.000Z","updated_at":"2025-02-26T18:07:13.000Z","dependencies_parsed_at":"2024-09-17T18:17:30.920Z","dependency_job_id":"75ded0bc-1bb0-427c-a18b-bd8030b1815d","html_url":"https://github.com/Matejkob/swift-macro-compatibility-check","commit_stats":null,"previous_names":["matejkob/swift-macro-compatibility-check"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matejkob%2Fswift-macro-compatibility-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matejkob%2Fswift-macro-compatibility-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matejkob%2Fswift-macro-compatibility-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Matejkob%2Fswift-macro-compatibility-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Matejkob","download_url":"https://codeload.github.com/Matejkob/swift-macro-compatibility-check/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674624,"owners_count":21143759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd","swift","testing","xcode"],"created_at":"2024-10-11T21:10:47.065Z","updated_at":"2025-04-13T06:31:18.224Z","avatar_url":"https://github.com/Matejkob.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Macro Compatibility Check\n\nThis GitHub Action verifies compatibility of a Swift package with macros against all `swift-syntax` versions.\n\n## Motivation\n\nThe introduction of macros in Swift 5.9 has significantly changed how many Swift libraries interact with `swift-syntax`. As pointed out by Point-Free in their article [Being a good citizen in the land of SwiftSyntax](https://www.pointfree.co/blog/posts/116-being-a-good-citizen-in-the-land-of-swiftsyntax) this change has brought about several challenges:\n\n1. **Versioning Complexity**: `swift-syntax` uses a versioning scheme where major versions correspond to minor versions of Swift (e.g., SwiftSyntax 509.0 corresponds to Swift 5.9). This complicates dependency management.\n\n1. **Breaking Changes**: `swift-syntax` has had breaking changes in minor releases, which causes compatibility issues.\n\n1. **Dependency Resolution**: With more libraries using `swift-syntax` for macros, there's an increased likelihood of unresolvable dependency graphs due to multiple libraries needing different major versions of the package.\n\nThis action aims to address these challenges by:\n\n- Ensuring your macros are compatible with multiple versions of `swift-syntax`.\n- Allowing you to easily test against both major versions and all minor versions.\n- Helping you catch potential compatibility issues early in your development process.\n\nBy using this action, you're taking a step towards being a **good citizen in the Swift ecosystem**, helping to prevent dependency conflicts and ensuring your library works across a range of `swift-syntax` versions.\n\n## Usage\n\nTo use this action in your workflow, add the following step:\n\n```yaml\n- name: Run Swift Macro Compatibility Check\n  uses: Matejkob/swift-macro-compatibility-check@v1\n```\n\n\u003e [!IMPORTANT]\n\u003e Make sure to run this action on a macOS runner:\n\n```yaml\njobs:\n  check-macro-compatibility:\n    runs-on: macos-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n      - name: Run Swift Macro Compatibility Check\n        uses: Matejkob/swift-macro-compatibility-check@v1\n```\n\n## Inputs\n\n| Input                 | Description                                                   | Required | Default |\n|-----------------------|---------------------------------------------------------------|----------|---------|\n| `run-tests`           | Whether to run tests (true/false)                             | false    | false   |\n| `major-versions-only` | Whether to test only against major versions (true/false)      | false    | false   |\n| `verbose`             | Whether to use verbose output for Swift commands (true/false) | false    | false   |\n\n## `swift-syntax` Versions\n\nThe action tests against the following `swift-syntax` versions:\n\n- `509.0.0`\n- `509.0.1`\n- `509.0.2`\n- `509.1.0`\n- `509.1.1`\n- `510.0.0`\n- `510.0.1`\n- `510.0.2`\n- `510.0.3`\n- `600.0.0`\n- `600.0.1`\n\nWhen `major-versions-only` is set to `true`, only versions `509.0.0`, `510.0.0`, and `600.0.0` are tested.\n\n## Running the Script Locally\n\nIf you'd like to run the compatibility check script locally without GitHub Actions, you can do so by executing the provided bash script [`swift-macro-compatibility-check.sh`](swift-macro-compatibility-check.sh) in your terminal.\n\n### Usage\n\n```bash\n./swift-macro-compatibility-check.sh [--run-tests] [--major-versions-only] [--verbose]\n```\n\n### Script Overview\n\nThe script checks the compatibility of a Swift package with multiple versions of `swift-syntax`. It can be configured to run tests and provide verbose output. The script performs the following steps for each version of `swift-syntax`:\n\n1. Resolves package dependencies for the specific `swift-syntax` version.\n2. Builds the Swift package.\n3. Optionally runs tests.\n4. Outputs a summary indicating which versions succeeded and which failed.\n\n## Examples\n\n### Basic Usage in GitHub Actions\n\n```yaml\nname: Swift Macro Compatibility\n\non: [push, pull_request]\n\njobs:\n  check-compatibility:\n    runs-on: macos-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n      - name: Run Swift Macro Compatibility Check\n        uses: Matejkob/swift-macro-compatibility-check@v1\n```\n\n### With All Options\n\n```yaml\nname: Swift Macro Compatibility\n\non: [push, pull_request]\n\njobs:\n  check-compatibility:\n    runs-on: macos-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v4\n      - name: Run Swift Macro Compatibility Check\n        uses: Matejkob/swift-macro-compatibility-check@v1\n        with:\n          run-tests: 'true'\n          major-versions-only: 'false'\n          verbose: 'true'\n```\n\n## Contributing\n\nContributions to improve the action or script are welcome. Please feel free to submit issues or pull requests.\n\n## License\n\nThis GitHub Action and the associated script are released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatejkob%2Fswift-macro-compatibility-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatejkob%2Fswift-macro-compatibility-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatejkob%2Fswift-macro-compatibility-check/lists"}