-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from MatsMoll/develop
More open access to Kognita
- Loading branch information
Showing
8 changed files
with
354 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: MasterAction | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
check-doc-coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Calculate Documentation Coverage | ||
uses: MatsMoll/swift-doc@master | ||
with: | ||
inputs: "Sources" | ||
output: "dcov.json" | ||
- name: Check Documentation Percent | ||
run: sudo bash CI/check-percentage.sh dcov.json 1 | ||
|
||
bionic-tests: | ||
needs: check-doc-coverage | ||
services: | ||
postgres: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Run unit tests master | ||
run: swift test --enable-test-discovery | ||
env: | ||
DATABASE_USER: postgres | ||
DATABASE_PASSWORD: postgres | ||
DATABASE_DB: postgres | ||
DATABASE_HOSTNAME: localhost | ||
|
||
release-docs: | ||
needs: bionic-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Generate Documentation | ||
uses: SwiftDocOrg/swift-doc@master | ||
with: | ||
inputs: "Sources" | ||
module-name: KognitaWeb | ||
output: "Documentation" | ||
- name: Upload Documentation to Wiki | ||
uses: SwiftDocOrg/github-wiki-publish-action@v1 | ||
with: | ||
path: "Documentation" | ||
env: | ||
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
|
||
release-version: | ||
needs: release-docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Release new version | ||
uses: MatsMoll/action-finch@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} | ||
GITHUB_SHA: ${{ secrets.GITHUB_SHA }} | ||
FINCH_CONFIG: CI/finch-config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
name: Swift | ||
name: DevelopAction | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
- rc/* | ||
- 1.* | ||
|
||
jobs: | ||
bionic-job: | ||
check-doc-coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Calculate Documentation Coverage | ||
uses: MatsMoll/swift-doc@master | ||
with: | ||
inputs: "Sources" | ||
output: "dcov.json" | ||
- name: Check Documentation Percent | ||
run: sudo bash CI/check-percentage.sh dcov.json 1 | ||
|
||
bionic-tests: | ||
needs: check-doc-coverage | ||
services: | ||
psql: | ||
postgres: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
|
@@ -26,33 +35,11 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: GitHub Action for SwiftLint | ||
uses: norio-nomura/[email protected] | ||
- name: Run unit tests | ||
if: github.ref != 'refs/heads/master' | ||
run: swift test --enable-test-discovery | ||
env: | ||
BUILD_TYPE: DEV | ||
DATABASE_USER: postgres | ||
DATABASE_PASSWORD: postgres | ||
DATABASE_DB: postgres | ||
DATABASE_HOSTNAME: localhost | ||
run: swift test | ||
- name: Run unit tests master | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
DATABASE_USER: postgres | ||
DATABASE_PASSWORD: postgres | ||
DATABASE_DB: postgres | ||
DATABASE_HOSTNAME: localhost | ||
run: swift test | ||
- name: Build library in release mode | ||
if: github.ref == 'refs/heads/master' | ||
run: swift build -c release | ||
- name: Release new version | ||
uses: MatsMoll/action-finch@master | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} | ||
GITHUB_SHA: ${{ secrets.GITHUB_SHA }} | ||
FINCH_CONFIG: CI/finch-config.yml | ||
DATABASE_HOSTNAME: localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
PERCENT="$(cat "$1" | jq ".data.totals.percent")" | ||
THRESHOLD="$2" | ||
if [ "${PERCENT%.*}" -ge "$THRESHOLD" ] | ||
then | ||
echo "Looking good with $PERCENT% coverage" | ||
exit 0 | ||
else | ||
echo "Only $PERCENT% coverage. Needs $THRESHOLD% or more" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
User-agent: * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.