Skip to content

Commit b69ef2c

Browse files
committed
Add code coverage uploads, CodeQL scanning, and dependency graph submission
1 parent c247c43 commit b69ef2c

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

.github/workflows/test.yml

+49-2
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,21 @@ jobs:
5151
-enableThreadSanitizer YES \
5252
-enableCodeCoverage YES \
5353
-disablePackageRepositoryCache \
54+
-resultBundlePath "${GITHUB_WORKSPACE}" \
5455
-destination "${DESTINATION}" |
5556
xcbeautify --is-ci --quiet --renderer github-actions
57+
- name: Upload coverage data
58+
uses: codecov/codecov-action@v3
59+
with:
60+
swift: true
61+
verbose: true
62+
xcode: true
63+
xcode_archive_path: ${{ github.workspace }}
5664

5765
linux:
5866
if: ${{ !(github.event.pull_request.draft || false) }}
5967
strategy:
60-
fail-fast: false
68+
fail-fast: falsex
6169
matrix:
6270
swift-image:
6371
- swift:5.9-jammy
@@ -72,7 +80,7 @@ jobs:
7280
- name: Install xcbeautify
7381
run: |
7482
DEBIAN_FRONTEND=noninteractive apt-get update
75-
DEBIAN_FRONTEND=noninteractive apt-get install -y xz-utils curl
83+
DEBIAN_FRONTEND=noninteractive apt-get install -y curl
7684
curl -fsSLO 'https://github.com/tuist/xcbeautify/releases/download/1.0.1/xcbeautify-1.0.1-x86_64-unknown-linux-gnu.tar.xz'
7785
tar -x -J -f xcbeautify-1.0.1-x86_64-unknown-linux-gnu.tar.xz
7886
- name: Run tests
@@ -81,3 +89,42 @@ jobs:
8189
set -o pipefail && \
8290
swift test --sanitize=thread --enable-code-coverage |
8391
./xcbeautify --is-ci --quiet --renderer github-actions
92+
- name: Upload coverage data
93+
uses: vapor/[email protected]
94+
95+
codeql:
96+
if: ${{ !(github.event.pull_request.draft || false) }}
97+
name: CodeQL Analysis
98+
runs-on: ubuntu-latest
99+
container:
100+
image: swift:5.9-jammy
101+
permissions: { actions: write, contents: read, security-events: write }
102+
steps:
103+
- name: Checkout code
104+
uses: actions/checkout@v4
105+
- name: Mark repo safe
106+
run: |
107+
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
108+
- name: Initialize CodeQL
109+
uses: github/codeql-action/init@v2
110+
with: { languages: swift }
111+
- name: Perform build
112+
run: swift build
113+
- name: Run CodeQL analyze
114+
uses: github/codeql-action/analyze@v2
115+
116+
dependency-graph:
117+
if: ${{ github.event_name == 'push' }}
118+
runs-on: ubuntu-latest
119+
container: swift:jammy
120+
permissions:
121+
contents: write
122+
steps:
123+
- name: Check out code
124+
uses: actions/checkout@v4
125+
- name: Set up dependencies
126+
run: |
127+
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
128+
apt-get update && apt-get install -y curl
129+
- name: Submit dependency graph
130+
uses: vapor-community/[email protected]

0 commit comments

Comments
 (0)