Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
37 changes: 34 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,34 @@ on:
- main

jobs:
get_os:
name: Determine supported OS
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check and output correct matrix
id: output_data
run: |
if [ -e .github/macos_only ]
then
echo "::set-output name=os_matrix::['macOS-latest']"
echo "::set-output name=coverage_os::macOS-latest"
else
echo "::set-output name=os_matrix::['macOS-latest', 'ubuntu-latest']"
echo "::set-output name=coverage_os::ubuntu-latest"
fi
outputs:
os_matrix: ${{ steps.output_data.outputs.os_matrix }}
coverage_os: ${{ steps.output_data.outputs.coverage_os }}

test:
name: Tests
runs-on: ${{ matrix.os }}
needs: get_os
strategy:
matrix:
os: [macOS-latest]
os: ${{fromJson(needs.get_os.outputs.os_matrix)}}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -23,25 +45,34 @@ jobs:
- name: Run tests
run: swift test --enable-code-coverage -Xswiftc -warnings-as-errors
- name: Generate test coverage report
if: ${{ matrix.os == needs.get_os.outputs.coverage_os }}
uses: maxep/spm-lcov-action@0.3.1
with:
output-file: ./coverage/lcov.info
- name: 'Read minimum coverage'
if: ${{ matrix.os == needs.get_os.outputs.coverage_os }}
run: echo "minimum_coverage=$(cat ./.github/minimum_coverage.txt)" >> $GITHUB_ENV
- name: Enforce test coverage threshhold
if: ${{ matrix.os == needs.get_os.outputs.coverage_os }}
uses: VeryGoodOpenSource/very_good_coverage@v1.1.1
with:
path: ./coverage/lcov.info
min_coverage: 0
min_coverage: ${{ env.minimum_coverage }}
- name: Save PR number
if: ${{ matrix.os == needs.get_os.outputs.coverage_os }}
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- name: Move Coverage Report
if: ${{ matrix.os == needs.get_os.outputs.coverage_os }}
run: mv ./coverage/lcov.info ./pr/lcov.info
- name: Upload Coverage Information for Comment
if: ${{ matrix.os == needs.get_os.outputs.coverage_os }}
uses: actions/upload-artifact@v2
with:
name: pr
path: pr/

swiftlint:
name: SwiftLint
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
.swiftpm
.build/
12 changes: 6 additions & 6 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Updated for 0.39.2 (Fix 1)
# Updated for 0.42.0

excluded:
- ".build"
Expand Down Expand Up @@ -83,19 +83,19 @@ opt_in_rules:
- optional_enum_case_matching
- prefer_self_type_over_type_of_self
- orphaned_doc_comment
#- tuple_pattern
#- return_value_from_void_function
#- void_function_in_ternary
#- prohibited_nan_comparison
- prefer_zero_over_explicit_init
- test_case_accessibility

disabled_rules:
- trailing_comma

line_length: 175
function_body_length: 30
identifier_name:
excluded:
- id
max_length:
warning: 45
type_name:
max_length:
warning: 45
warning: 45
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Steffen Koette (@Nef10)
Copyright (c) 2017 - 2021 Steffen Koette (@Nef10)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down