Skip to content

Commit

Permalink
Merge pull request #21 from tlazenka/develop
Browse files Browse the repository at this point in the history
Develop into main
  • Loading branch information
tlazenka authored Jun 4, 2021
2 parents 7156565 + 0d18007 commit d04b81b
Show file tree
Hide file tree
Showing 51 changed files with 2,836 additions and 2,789 deletions.
5 changes: 5 additions & 0 deletions .github/actions/swift-test-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM swift:5.4

COPY . .

CMD ["swift", "test", "--enable-test-discovery"]
4 changes: 4 additions & 0 deletions .github/actions/swift-test-docker/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: 'swift test'
runs:
using: 'docker'
image: 'Dockerfile'
56 changes: 56 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Swift

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
env:
DEVELOPER_DIR: /Applications/Xcode_12.app/Contents/Developer

jobs:
test:

runs-on: macos-latest
env:
working_directory: ./

steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
working-directory: ${{env.working_directory}}
- name: Run tests
run: swift test -v
working-directory: ${{env.working_directory}}

format:

runs-on: macos-latest

steps:
- name: Install Mint
run: brew install mint
- uses: actions/checkout@v2
- name: Run SwiftFormat lint
run: mint run nicklockwood/SwiftFormat@0.46.2 --lint .

repl:

runs-on: macos-latest
env:
working_directory: ./Repl

steps:
- uses: actions/checkout@v2
- name: Build
run: swift build -v
working-directory: ${{env.working_directory}}

test-docker:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/swift-test-docker
4 changes: 4 additions & 0 deletions Swona/.gitignore → .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.swiftpm

/.idea

.DS_Store
/.build
/Packages
Expand Down
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.3
36 changes: 36 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--exclude Repl/Sources/Repl/Resources.swift

--allman false
--binarygrouping 4,8
--commas always
--comments indent
--decimalgrouping 3,6
--elseposition same-line
--empty void
--exponentcase lowercase
--exponentgrouping disabled
--fractiongrouping disabled
--header ignore
--hexgrouping 4,8
--hexliteralcase uppercase
--ifdef indent
--indent 4
--indentcase false
--importgrouping testable-bottom
--linebreaks lf
--maxwidth none
--octalgrouping 4,8
--operatorfunc spaced
--patternlet hoist
--ranges spaced
--self remove
--semicolons inline
--stripunusedargs always
--swiftversion 4.2
--trimwhitespace always
--wraparguments preserve
--wrapcollections preserve
--modifierorder public,override

--enable isEmpty
--disable redundantRawValues
4 changes: 1 addition & 3 deletions Dockerfile.swift → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM swift:5.0
FROM swift:5.4

ENV APP_HOME /app
WORKDIR $APP_HOME

COPY . .

WORKDIR /app/Repl

CMD ["swift", "build"]
32 changes: 32 additions & 0 deletions Dockerfile.swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# MIT License
# Copyright (c) 2020 Takuhiro Muta
# https://github.com/417-72KI/Docker-Swift-Mint/blob/master/LICENSE

ARG SWIFT_VERSION=5.4
FROM swift:${SWIFT_VERSION}

ARG MINT_REVISION=0.16.0
ENV MINT_REVISION=${MINT_REVISION}

ARG SWIFT_FORMAT_REVISION=0.46.2
ENV SWIFT_FORMAT_REVISION=${SWIFT_FORMAT_REVISION}

# Install Mint
RUN git clone -b "${MINT_REVISION}" --depth 1 "https://github.com/yonaskolb/Mint.git" ~/Mint && \
cd ~/Mint && \
swift build --disable-sandbox -c release && \
mkdir -p /usr/local/bin && \
cp -f .build/release/mint /usr/local/bin/mint && \
cd && \
rm -rf ~/Mint

RUN mint install nicklockwood/SwiftFormat@${SWIFT_FORMAT_REVISION}

ENV APP_HOME /app
WORKDIR $APP_HOME

COPY . .

WORKDIR /app/Repl

CMD ["swiftformat", "."]
Loading

0 comments on commit d04b81b

Please sign in to comment.