|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - # This runs in the context of the base of the pull request, |
5 | | - # rather than in the context of the merge commit. |
6 | | - # Maintainers must approve and we tighten permissions below. |
7 | | - pull_request_target: |
8 | | - types: [opened, synchronize, reopened] |
| 4 | + # This runs in the context of the base of the pull request, |
| 5 | + # rather than in the context of the merge commit. |
| 6 | + # Maintainers must approve and we tighten permissions below. |
| 7 | + pull_request_target: |
| 8 | + types: [opened, synchronize, reopened] |
9 | 9 |
|
10 | 10 | permissions: |
11 | | - contents: read |
| 11 | + contents: read |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - test: |
15 | | - name: Test |
16 | | - uses: huggingface/hf-workflows/.github/workflows/swift_transformers_unit_tests.yml@main |
| 14 | + test: |
| 15 | + name: Test |
| 16 | + uses: huggingface/hf-workflows/.github/workflows/swift_transformers_unit_tests.yml@main |
| 17 | + with: |
| 18 | + # Use the PR merge ref, not the head. |
| 19 | + pr_number: ${{ github.event.pull_request.number }} |
| 20 | + secrets: inherit |
| 21 | + |
| 22 | + lint: |
| 23 | + name: Lint |
| 24 | + runs-on: macos-latest |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + |
| 29 | + - name: Set up Swift |
| 30 | + uses: swift-actions/setup-swift@v2 |
17 | 31 | with: |
18 | | - # Use the PR merge ref, not the head. |
19 | | - pr_number: ${{ github.event.pull_request.number }} |
20 | | - secrets: inherit |
21 | | - |
22 | | - lint: |
23 | | - name: Lint |
24 | | - runs-on: macos-latest |
25 | | - |
26 | | - steps: |
27 | | - - uses: actions/checkout@v4 |
28 | | - |
29 | | - - name: Set up Swift |
30 | | - uses: swift-actions/setup-swift@v2 |
31 | | - with: |
32 | | - swift-version: "6.1" |
33 | | - |
34 | | - - run: | |
35 | | - swift format lint --strict --recursive . |
36 | | -
|
37 | | - - name: Suggest fixes (if check fails) |
38 | | - if: failure() |
39 | | - run: | |
40 | | - echo "### Here's how to fix the formatting locally:" >> $GITHUB_STEP_SUMMARY |
41 | | - echo "" >> $GITHUB_STEP_SUMMARY |
42 | | - echo "```bash" >> $GITHUB_STEP_SUMMARY |
43 | | - echo "# Format all Swift files" >> $GITHUB_STEP_SUMMARY |
44 | | - echo 'swift format -i --recursive .' >> $GITHUB_STEP_SUMMARY |
45 | | - echo '```' >> $GITHUB_STEP_SUMMARY |
| 32 | + swift-version: "6.1" |
| 33 | + |
| 34 | + - run: | |
| 35 | + swift format lint --strict --recursive . |
| 36 | +
|
| 37 | + - name: Suggest fixes (if check fails) |
| 38 | + if: failure() |
| 39 | + run: | |
| 40 | + echo "### Here's how to fix the formatting locally:" >> $GITHUB_STEP_SUMMARY |
| 41 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 42 | + echo '```bash' >> $GITHUB_STEP_SUMMARY |
| 43 | + echo "# Format all Swift files" >> $GITHUB_STEP_SUMMARY |
| 44 | + echo 'swift format -i --recursive .' >> $GITHUB_STEP_SUMMARY |
| 45 | + echo '```' >> $GITHUB_STEP_SUMMARY |
0 commit comments