Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lovetodream committed Apr 22, 2024
1 parent ef20dfe commit 17c2fa6
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 34 deletions.
17 changes: 17 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
changelog:
exclude:
labels:
- semver-noop
categories:
- title: SemVer Major
labels:
- semver-major
- title: SemVer Minor
labels:
- semver-minor
- title: SemVer Patch
labels:
- semver-patch
- title: Other Changes
labels:
- "*"
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
soundness:
name: Soundness Checks

steps:
- uses: actions/checkout@v4
- name: Run soundness
run: |
scripts/soundness.sh
exit $(git status --porcelain | wc -l)

tests:
container:
image: swift:5.9-jammy

runs-on: ubuntu-latest

services:
loki:
image: grafana/loki:3.0.0

steps:
- uses: actions/checkout@v4
- name: Cache Swift PM
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-ci-spm-${{ hashFiles('Package.swift') }}
restore-keys: ${{ runner.os }}-ci-spm-
- name: Build
run: swift build
- name: Run tests
run: swift test --enable-code-coverage
env:
XCT_LOKI_URL: http://loki:3100
- name: Prepare Code Coverage
run: |
llvm-cov export -format="lcov" \
.build/debug/swift-log-lokiPackageTests.xctest \
-instr-profile .build/debug/codecov/default.profdata \
-ignore-filename-regex="\.pb\.swift" \
-ignore-filename-regex="\/Tests\/" \
> info.lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: info.lcov
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write

container: swift:5.9-jammy

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Cache Swift PM
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-codeql-spm-${{ hashFiles('Package.swift') }}
restore-keys: ${{ runner.os }}-codeql-spm-

- name: Resolve Swift dependencies
run: swift package resolve

- name: Build
run: swift build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
34 changes: 0 additions & 34 deletions .github/workflows/tests.yml

This file was deleted.

0 comments on commit 17c2fa6

Please sign in to comment.