Skip to content
Open
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
18 changes: 18 additions & 0 deletions .github/workflows/configlet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This workflow fetches the latest configlet binary and lints this repository

name: Configlet

on: pull_request

jobs:
lint:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Fetch configlet
uses: exercism/github-actions/configlet-ci@master

- name: Configlet Linter
run: configlet lint .
33 changes: 33 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Danger + SwiftLint

on:
pull_request:
paths:
- '.github/workflows/danger.yml'
- '.swiftlint.yml'
- '**/*.swift'
- 'Dangerfile'
- 'Gemfile'
- 'Gemfile.lock'

jobs:
lint_danger:
runs-on: ubuntu-18.04

steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Install bundler and danger gems
run: sudo gem install bundler && bundle install

- name: Run SwiftLint and output to lintreport.json
run: swiftlint lint --quiet --reporter json | tee lintreport.json

- name: Run Danger to enforce PR guidelines and note SwiftLint results
uses: MeilCli/danger-action@v5
with:
danger_file: 'Dangerfile'
danger_id: 'danger-pr'
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.danger_github_api_token }}
31 changes: 31 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow runs the Swift package manager

name: Swift package manager

on:
pull_request:
paths:
- '.github/workflows/package.yml'
- '**/*.swift'
- 'config.json'

jobs:
package_mac:
runs-on: macos-10.15

steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Generate Xcode project
run: swift package generate-xcodeproj

package_linux:
runs-on: ubuntu-18.04

steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Generate Xcode project
run: swift package generate-xcodeproj
31 changes: 31 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow runs SwiftLint on all Swift files

name: SwiftLint

on:
pull_request:
paths:
- '.github/workflows/swiftlint.yml'
- '.swiftlint.yml'
- '**/*.swift'

jobs:
lint_mac:
runs-on: macos-10.15

steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Run SwiftLint
run: swiftlint --reporter github-actions-logging

lint_linux:
runs-on: ubuntu-18.04

steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Run SwiftLint
uses: norio-nomura/[email protected]
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow runs each exercise's test suite

name: Exercise Tests

on:
pull_request:
paths:
- '.github/workflows/test.yml'
- 'exercises/*/Sources/*/*Example.swift'
- 'exercises/*/Tests/*/*Tests.swift'
- 'xswift-test-spm'

jobs:
test_mac:
runs-on: macos-10.15

steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Set up Swift environment using swiftenv
uses: YOCKOW/Action-setup-swift@v1
with:
swift-version: '5.3'

- name: Run exercise tests
run: ./xswift-test-spm

test_linux:
runs-on: ubuntu-18.04

steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Set up Swift environment using swiftenv
uses: YOCKOW/Action-setup-swift@v1
with:
swift-version: '5.3'

- name: Run exercise tests
run: ./xswift-test-spm
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ DerivedData
LinuxMain.swift
Package.resolved
xswift.xcodeproj/

lintreport.json
2 changes: 0 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ disabled_rules: # rule identifiers to exclude from running
- line_length
- trailing_comma
- force_try

reporter: "json"
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "danger"
63 changes: 63 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
claide (1.0.3)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (8.2.0)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (>= 0.9.0, < 2.0)
faraday-http-cache (~> 2.0)
git (~> 1.7)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
no_proxy_fix
octokit (~> 4.7)
terminal-table (~> 1)
faraday (1.1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday-http-cache (2.2.0)
faraday (>= 0.8)
git (1.7.0)
rchardet (~> 1.8)
kramdown (2.3.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
multipart-post (2.1.1)
nap (1.1.0)
no_proxy_fix (0.1.2)
octokit (4.19.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
public_suffix (4.0.6)
rchardet (1.8.0)
rexml (3.2.4)
ruby2_keywords (0.0.2)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)

PLATFORMS
ruby

DEPENDENCIES
danger

BUNDLED WITH
2.1.4
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- run: sudo gem install danger
- run: brew update
- run: brew ls --versions swiftlint && brew upgrade swiftlint || brew install swiftlint
- run: swiftlint lint --quiet | tee lintreport.json || true # Dont crash on errors
- run: swiftlint lint --quiet --reporter json | tee lintreport.json || true # Dont crash on errors
- run: ./xswift-test-spm
- run: swift package generate-xcodeproj
- run:
Expand Down