Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/github_actions_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check for Dependencies in PR

on:
workflow_call:

permissions:
issues: read
pull-requests: read

jobs:
check_dependencies:
runs-on: ubuntu-latest
name: "Check GitHub Actions Dependencies"
steps:
- uses: gregsdennis/dependencies-action@1.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 13 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@ name: Pull request

permissions:
contents: read
issues: read
pull-requests: read

on:
pull_request:
types: [opened, reopened, synchronize]
types: [opened, edited, reopened, labeled, unlabeled, synchronize]

jobs:
github_actiion_pr_dependency_check:
name: GitHub Action Dependency Check
uses: ./.github/workflows/github_actions_dependencies.yml

tests_with_docker_embedded_swift:
name: Test Embedded Swift SDKs
uses: ./.github/workflows/swift_package_test.yml
if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }}
with:
# Wasm
enable_linux_checks: false
Expand All @@ -23,6 +30,7 @@ jobs:
tests_with_docker:
name: Test with Docker
uses: ./.github/workflows/swift_package_test.yml
if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }}
with:
# Linux
linux_os_versions: '["jammy", "rhel-ubi9", "amazonlinux2"]'
Expand All @@ -46,6 +54,7 @@ jobs:
tests_without_docker:
name: Test without Docker
uses: ./.github/workflows/swift_package_test.yml
if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }}
with:
# Skip Linux which doesn't currently support docker-less workflow
enable_linux_checks: false
Expand All @@ -65,6 +74,7 @@ jobs:
tests_macos:
name: Test
uses: ./.github/workflows/swift_package_test.yml
if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }}
with:
enable_linux_checks: false
enable_windows_checks: false
Expand All @@ -77,6 +87,7 @@ jobs:
build_tests_ios:
name: Build iOS Tests
uses: ./.github/workflows/swift_package_test.yml
if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }}
with:
enable_linux_checks: false
enable_windows_checks: false
Expand All @@ -89,6 +100,7 @@ jobs:
soundness:
name: Soundness
uses: ./.github/workflows/soundness.yml
if: ${{ github.event_name == 'opened' || github.event_name == 'reopened' || github.event_name == 'synchronize' }}
with:
api_breakage_check_enabled: false
license_header_check_project_name: "Swift.org"
33 changes: 33 additions & 0 deletions docs/pr-dependency-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# PR Dependency Workflow Documentation

## Overview

The [`github_actions_dependencies.yml`](.github/workflows/github_actions_dependencies.yml) workflow uses [a third party GitHub action](https://github.com/marketplace/actions/pr-dependency-check) to enforce PR dependencies.

At the time of writing, the GitHub action supported the following styles, for both issues and PRs.:

- Quick Link: `#5`
- Partial Link: `gregsdennis/dependencies-action#5`
- Partial URL: `gregsdennis/dependencies-action/pull/5`
- Full URL: `https://github.com/gregsdennis/dependencies-action/pull/5`
- Markdown: `[markdown link](https://github.com/gregsdennis/dependencies-action/pull/5)`

## Usage

Add the following to a `.yaml` file in your `.github/workflows` directory:

```
name: Check for GitHub Actions Dependencies in PR

on:
pull_request_target:
types: [opened, edited, reopened, labeled, unlabeled, synchronize]

permissions:
issues: read
pull-requests: read

jobs:
check_dependencies:
uses: swiftlang/github-workflows/.github/workflows/github_actions_dependencies.yml.yml@<to-be-updated>
```