Skip to content

Commit

Permalink
CI: test adding codeQL
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed May 7, 2024
1 parent 8afd803 commit f8e81c7
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 29 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CodeQl
on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
deploy:
name: Running unit tests
runs-on: macos-14
steps:
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'

- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Get current date
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: "swift"

- name: Test
run: xcodebuild -scheme KukaiCryptoSwift -destination "platform=iOS Simulator,OS=17.2,name=iPhone 15"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:swift"
53 changes: 24 additions & 29 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: Unit Test

# Run unit tests on every push or pull request, to main or develop
on:
push:
branches:
Expand All @@ -11,35 +9,32 @@ on:
- main
- develop

# Checkout the code, and run mxcl's xcodebuild action to run the unit tests
jobs:
build:
runs-on: macos-12
strategy:
matrix:
platform:
- iOS
- macOS
xcode:
- ^14
deploy:
name: Running unit tests
runs-on: macos-14
steps:
- uses: actions/checkout@v4.1.1
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'

- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: "swift"
- name: Get current date
run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV

- uses: mxcl/xcodebuild@v2.0
with:
platform: ${{ matrix.platform }}
xcode: ${{ matrix.xcode }}
action: test
scheme: KukaiCryptoSwift
code-coverage: true
upload-logs: always

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Test
run: xcodebuild test -scheme KukaiCryptoSwift -destination "platform=iOS Simulator,OS=17.2,name=iPhone 15" -enableCodeCoverage YES -resultBundlePath "~/xcode-$NOW.xcresult"

- name: Upload results
if: ${{ success() || failure() }}
uses: actions/upload-artifact@v4.3.1
with:
category: "/language:swift"
name: "results-${{ env.NOW }}.xcresult"
path: "~/xcode-${{ env.NOW }}.xcresult"






0 comments on commit f8e81c7

Please sign in to comment.