-
Notifications
You must be signed in to change notification settings - Fork 169
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 #316 from argentlabs/develop
Sync to master (1.5.0)
- Loading branch information
Showing
86 changed files
with
2,472 additions
and
1,527 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 |
---|---|---|
@@ -1,25 +1,42 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
pull_request_target: | ||
branches: [ develop ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Lint | ||
run: ./scripts/runSwiftFormat.sh -l | ||
macos: | ||
needs: lint | ||
runs-on: macos-latest | ||
env: | ||
TESTS_PRIVATEKEY: ${{ secrets.TESTS_PRIVATEKEY }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: SetupKey | ||
run: ./scripts/setupKey.sh "${{ secrets.TESTS_PRIVATEKEY }}" | ||
- name: Build | ||
run: swift build -v | ||
- name: Tests | ||
run: swift test -v | ||
linux: | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
container: | ||
image: swift:5.5-bionic | ||
env: | ||
TESTS_PRIVATEKEY: ${{ secrets.TESTS_PRIVATEKEY }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: SetupKey | ||
run: ./scripts/setupKey.sh "${{ secrets.TESTS_PRIVATEKEY }}" | ||
- name: Build | ||
run: swift build -v | ||
- name: Tests | ||
run: swift test -v | ||
run: swift test -v |
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
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,7 @@ | ||
#!/bin/sh | ||
|
||
SWIFT_VERSION=5.3 | ||
|
||
cd "$(dirname "$0")" | ||
|
||
./runSwiftFormat.sh |
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,63 @@ | ||
#!/bin/sh | ||
|
||
SWIFT_VERSION=5.3 | ||
|
||
cd "$(dirname "$0")" | ||
|
||
function downloadAndUnzip { | ||
curl -L -o tool.zip $2 | ||
unzip -o -d $1/ tool.zip | ||
rm tool.zip | ||
} | ||
|
||
if ! which bin/swiftformat >/dev/null; then | ||
echo "warning: SwiftFormat not installed, installing..." | ||
|
||
mkdir -p -- "bin" | ||
cd bin | ||
rm -r ./* | ||
|
||
downloadAndUnzip "SwiftFormatTmp" "https://github.com/nicklockwood/SwiftFormat/releases/download/0.50.3/swiftformat.artifactbundle.zip" | ||
mv -f ./SwiftFormatTmp/swiftformat.artifactbundle/swiftformat-0.50.3-macos/bin/swiftformat . | ||
find . -name "*Tmp" -type d -prune -exec rm -rf '{}' + | ||
for entry in ./* | ||
do | ||
chmod +x "$entry" | ||
done | ||
cd ../ | ||
fi | ||
|
||
cleanup() { | ||
exit_code=$? | ||
if [[ ${exit_code} -eq 0 ]]; then | ||
exit 0 | ||
else | ||
echo "Need to run scripts/prepareForPush.sh script to prepare the code before a PullRequest." | ||
exit 1 | ||
fi | ||
} | ||
|
||
format() { | ||
bin/swiftformat ../web3swift/src/ --config "swiftformat.yml" --swiftversion $SWIFT_VERSION | ||
cleanup | ||
} | ||
|
||
lint() { | ||
bin/swiftformat --lint ../web3swift/src/ --config "swiftformat.yml" --swiftversion $SWIFT_VERSION | ||
cleanup | ||
} | ||
|
||
while getopts "fl" o; do | ||
case "${o}" in | ||
f) | ||
format; | ||
exit;; | ||
l) | ||
lint; | ||
exit;; | ||
*) | ||
exit;; | ||
esac | ||
done | ||
|
||
format |
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,4 @@ | ||
#!/bin/sh | ||
|
||
# write first argument to a Test | ||
echo "extension TestConfig {\nstatic let privateKey = \"$1\"\nstatic let publicKey = \"0xE78e5ecb061fE3DD1672dDDA7b5116213B23B99A\"\n}" > web3sTests/TestConfig_private.swift |
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,79 @@ | ||
--acronyms ID,URL,UUID | ||
--allman false | ||
--assetliterals visual-width | ||
--beforemarks | ||
--binarygrouping 4,8 | ||
--categorymark "MARK: %c" | ||
--classthreshold 0 | ||
--closingparen balanced | ||
--closurevoid remove | ||
--commas always | ||
--conflictmarkers reject | ||
--decimalgrouping 3,6 | ||
--elseposition same-line | ||
--emptybraces no-space | ||
--enumnamespaces always | ||
--enumthreshold 0 | ||
--exponentcase lowercase | ||
--exponentgrouping disabled | ||
--extensionacl on-extension | ||
--extensionlength 0 | ||
--extensionmark "MARK: - %t + %c" | ||
--fractiongrouping disabled | ||
--fragment false | ||
--funcattributes prev-line | ||
--generictypes | ||
--groupedextension "MARK: %c" | ||
--guardelse same-line | ||
--header ignore | ||
--hexgrouping 4,8 | ||
--hexliteralcase uppercase | ||
--ifdef indent | ||
--importgrouping length | ||
--indent 4 | ||
--indentcase false | ||
--indentstrings false | ||
--lifecycle | ||
--lineaftermarks false | ||
--linebreaks lf | ||
--markcategories true | ||
--markextensions always | ||
--marktypes always | ||
--maxwidth none | ||
--modifierorder | ||
--nevertrailing | ||
--nospaceoperators | ||
--nowrapoperators | ||
--octalgrouping 4,8 | ||
--operatorfunc spaced | ||
--organizetypes actor,class,enum,struct | ||
--patternlet hoist | ||
--ranges spaced | ||
--redundanttype infer-locals-only | ||
--self remove | ||
--selfrequired | ||
--semicolons inline | ||
--shortoptionals always | ||
--smarttabs enabled | ||
--someAny true | ||
--stripunusedargs always | ||
--structthreshold 0 | ||
--tabwidth unspecified | ||
--trailingclosures | ||
--trimwhitespace always | ||
--typeattributes prev-line | ||
--typeblanklines remove | ||
--typemark "MARK: - %t" | ||
--varattributes same-line | ||
--voidtype void | ||
--wraparguments before-first | ||
--wrapcollections before-first | ||
--wrapconditions preserve | ||
--wrapparameters before-first | ||
--wrapreturntype preserve | ||
--wrapternary default | ||
--wraptypealiases preserve | ||
--xcodeindentation disabled | ||
--yodaswap always | ||
--disable enumNamespaces,extensionAccessControl,fileHeader,genericExtensions,modifierOrder,numberFormatting,opaqueGenericParameters,preferKeyPath,redundantBackticks,redundantExtensionACL,redundantFileprivate,redundantPattern,redundantRawValues,redundantSelf,sortDeclarations,spaceAroundGenerics,strongOutlets,trailingClosures,trailingCommas,unusedArguments,wrap,wrapMultilineStatementBraces,wrapSingleLineComments,yodaConditions | ||
--enable blankLineAfterImports,blankLinesBetweenImports,isEmpty,wrapConditionalBodies |
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.