Skip to content

Commit

Permalink
Fix tests by installing Swift-SH
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Jun 15, 2020
1 parent 5870afa commit 781274d
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
path: anylint-cache
key: ${{ runner.os }}-v1-anylint-${{ env.ANYLINT_LATEST_VERSION }}-swift-sh-${{ env.SWIFT_SH_LATEST_VERSION }}

- name: Copy from cache
- name: Copy from Cache
if: steps.anylint-cache.outputs.cache-hit
run: |
sudo cp -f anylint-cache/anylint /usr/local/bin/anylint
Expand All @@ -59,7 +59,7 @@ jobs:
swift build -c release
sudo cp -f .build/release/swift-sh /usr/local/bin/swift-sh
- name: Copy to cache
- name: Copy to Cache
if: steps.anylint-cache.outputs.cache-hit != 'true'
run: |
mkdir -p anylint-cache
Expand Down Expand Up @@ -89,16 +89,62 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Export latest tool versions
run: |
latest_version() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
}
echo "::set-env name=ANYLINT_LATEST_VERSION::$( latest_version Flinesoft/AnyLint )"
echo "::set-env name=SWIFT_SH_LATEST_VERSION::$( latest_version mxcl/swift-sh )"
- name: AnyLint Cache
uses: actions/cache@v1
id: anylint-cache
with:
path: anylint-cache
key: ${{ runner.os }}-v1-anylint-${{ env.ANYLINT_LATEST_VERSION }}-swift-sh-${{ env.SWIFT_SH_LATEST_VERSION }}

- name: Copy from Cache
if: steps.anylint-cache.outputs.cache-hit
run: |
sudo cp -f anylint-cache/anylint /usr/local/bin/anylint
sudo cp -f anylint-cache/swift-sh /usr/local/bin/swift-sh
- name: Install AnyLint
if: steps.anylint-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/Flinesoft/AnyLint.git
cd AnyLint
swift build -c release
sudo cp -f .build/release/anylint /usr/local/bin/anylint
- name: Install swift-sh
if: steps.anylint-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/mxcl/swift-sh.git
cd swift-sh
swift build -c release
sudo cp -f .build/release/swift-sh /usr/local/bin/swift-sh
- name: Copy to Cache
if: steps.anylint-cache.outputs.cache-hit != 'true'
run: |
mkdir -p anylint-cache
cp -f /usr/local/bin/anylint anylint-cache/anylint
cp -f /usr/local/bin/swift-sh anylint-cache/swift-sh
- name: Run tests
run: swift test -v


test-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Install Swift-SH
run: brew install swift-sh

- name: Run tests
run: swift test -v --enable-code-coverage

Expand Down

0 comments on commit 781274d

Please sign in to comment.