Skip to content

Commit ac476aa

Browse files
authored
Run Swift linting job with Bazel for better caching (#6130)
1 parent f6c9633 commit ac476aa

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/lint.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,20 @@ jobs:
1313
lint-swift:
1414
name: Lint Swift
1515
runs-on: ubuntu-24.04 # "Noble Numbat"
16-
container: swift:6.1-noble
1716
steps:
1817
- uses: actions/checkout@v4
18+
- name: Create ci.bazelrc file
19+
run: echo "$CI_BAZELRC_FILE_CONTENT" | base64 -d > ci.bazelrc
20+
env:
21+
CI_BAZELRC_FILE_CONTENT: ${{ secrets.CI_BAZELRC_FILE_CONTENT }}
1922
- name: Lint
20-
run: swift run swiftlint --reporter github-actions-logging --strict 2> /dev/null
23+
run: |
24+
export PATH="/usr/share/swift/usr/bin:$PATH"
25+
git apply --ignore-whitespace .bcr/patches/no-warnings-as-errors.patch
26+
bazel build --config release //:swiftlint
27+
./bazel-bin/swiftlint lint --reporter github-actions-logging --strict 2> /dev/null
28+
env:
29+
CC: clang
2130
lint-markdown:
2231
name: Lint Markdown
2332
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)