Merge pull request #254 from mas-cli/phatblat/gh-action

👷🏻‍♂️ Add GitHub Actions Build & Test workflow
This commit is contained in:
Ben Chatelain 2021-03-28 14:07:53 -07:00 committed by GitHub
commit e40aaef6d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 75 additions and 27 deletions

35
.github/workflows/build-test.yml vendored Normal file
View file

@ -0,0 +1,35 @@
#
# .github/workflows/build-test.yml
#
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
name: Build & Test
on: [push]
jobs:
build-test:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: macOS-latest
steps:
# https://github.com/actions/checkout#usage
- uses: actions/checkout@master
with:
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow
token: ${{ secrets.GITHUB_TOKEN }}
- name: Bootstrap
run: script/bootstrap
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsenv
env:
# Carthage looks for GITHUB_ACCESS_TOKEN
# https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/GitHub.swift#L118
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: script/build
- name: Test
run: script/test

View file

@ -2,4 +2,6 @@ brew "carthage"
brew "make"
brew "mint"
brew "shellcheck"
tap "kylef/formulae"
brew "swiftenv"

View file

@ -25,28 +25,24 @@
}
},
"shellcheck": {
"version": "0.7.1",
"version": "0.7.1_1",
"bottle": {
"rebuild": 1,
"rebuild": 0,
"cellar": ":any_skip_relocation",
"prefix": "/usr/local",
"root_url": "https://homebrew.bintray.com/bottles",
"files": {
"big_sur": {
"url": "https://homebrew.bintray.com/bottles/shellcheck-0.7.1.big_sur.bottle.1.tar.gz",
"sha256": "c7bd19ca5bc623c8a958c4cb56b77ab89e652c20a1a66dfbbc0c5d8832b60ada"
"url": "https://homebrew.bintray.com/bottles/shellcheck-0.7.1_1.big_sur.bottle.tar.gz",
"sha256": "5ba3cfe883216a700c133e35c3f1612ab70eaca07cfb43bf6ed427b72dd7d552"
},
"catalina": {
"url": "https://homebrew.bintray.com/bottles/shellcheck-0.7.1.catalina.bottle.1.tar.gz",
"sha256": "0cd635d2172d5e6617be8cdfb2723b6aa6feb2aa22e36cb3172d8b6fa012f4a0"
"url": "https://homebrew.bintray.com/bottles/shellcheck-0.7.1_1.catalina.bottle.tar.gz",
"sha256": "bd66df0992ced04f98883eada3f14e620f6c76f268cae2adb182b52d3bba1858"
},
"mojave": {
"url": "https://homebrew.bintray.com/bottles/shellcheck-0.7.1.mojave.bottle.1.tar.gz",
"sha256": "37201a49c0d7a5be49c5d97d4f6f8f5fcfef7d700b4694f74648a1addcd6783d"
},
"high_sierra": {
"url": "https://homebrew.bintray.com/bottles/shellcheck-0.7.1.high_sierra.bottle.1.tar.gz",
"sha256": "1b20aeaba4d5e2e3df5cbe27636d655b6f877ee05a41d25fe1e0b3f9d00afa81"
"url": "https://homebrew.bintray.com/bottles/shellcheck-0.7.1_1.mojave.bottle.tar.gz",
"sha256": "bcb393cf5a259c69fdf7ef1725243b48c5653b9db17d2cd51ad140ab2d7de9c1"
}
}
}
@ -112,6 +108,34 @@
}
}
}
},
"swiftlint": {
"version": "0.43.1",
"bottle": {
"rebuild": 0,
"cellar": ":any_skip_relocation",
"prefix": "/usr/local",
"root_url": "https://homebrew.bintray.com/bottles",
"files": {
"arm64_big_sur": {
"url": "https://homebrew.bintray.com/bottles/swiftlint-0.43.1.arm64_big_sur.bottle.tar.gz",
"sha256": "e1b633e61793b924f5875e4812b49184c91fc6580bfd497ab650fe13fbbe8d8f"
},
"big_sur": {
"url": "https://homebrew.bintray.com/bottles/swiftlint-0.43.1.big_sur.bottle.tar.gz",
"sha256": "90faabe65db0f6bc43c3752b3b6d541e7e23cd0f368035dcef57503d74ed9581"
},
"catalina": {
"url": "https://homebrew.bintray.com/bottles/swiftlint-0.43.1.catalina.bottle.tar.gz",
"sha256": "c1396dec887bf6d7986c35f38101955fb1a5c527ad4cd459174b3841dfa62239"
}
}
}
}
},
"tap": {
"kylef/formulae": {
"revision": "00757e80d6861651d3dc18bbc978edf9a5d0a8a9"
}
}
},
@ -126,9 +150,9 @@
"macOS": "10.15.6"
},
"big_sur": {
"HOMEBREW_VERSION": "3.0.7-44-g7e2ba95",
"HOMEBREW_VERSION": "3.0.9-55-g3bfa59b",
"HOMEBREW_PREFIX": "/usr/local",
"Homebrew/homebrew-core": "d34154298ad4f6adcdae2895f82c33dc316f79a4",
"Homebrew/homebrew-core": "2fec1a1e5430c9b9f9fdb386f1ece5850b599ebf",
"CLT": "12.4.0.0.1.1610135815",
"Xcode": "12.4",
"macOS": "11.2.3"

View file

@ -1,3 +0,0 @@
apple/swift-format@0.50300.0
nicklockwood/SwiftFormat@0.47.11
realm/SwiftLint@0.42.0

View file

@ -18,11 +18,6 @@ main() {
# Install Mint and shellcheck
brew bundle install --no-upgrade --verbose
# Set up mint cache to be relative to user HOME
export MINT_PATH=~/.mint/cache
mkdir -p $MINT_PATH
mint bootstrap --link --verbose
# Download and build project dependencies
carthage bootstrap --platform macOS --cache-builds
}

View file

@ -49,11 +49,6 @@ fi
# fatal: Unable to create '/Users/ben/Library/Caches/org.carthage.CarthageKit/dependencies/Commandant/./index.lock': Operation not permitted
rm -rf ~/Library/Caches/org.carthage.CarthageKit
# Uninstall carthage via Mint, only when installed via mint
if [[ $(command -v mint >/dev/null) && $(mint which carthage >/dev/null) ]]; then
mint uninstall carthage
fi
################################################################################
#
# Build the formula for the current macOS version and architecture.