-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds gwv formula * Change dir * Tweaks Dockerfile * Wires CI check * Runs linters on CI
- Loading branch information
1 parent
205dac7
commit 6b164f4
Showing
7 changed files
with
139 additions
and
7 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,3 +1,6 @@ | ||
# Copyright 2024 Dotanuki Labs | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: CI | ||
|
||
on: | ||
|
@@ -7,13 +10,25 @@ on: | |
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Project Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Run essential checks | ||
uses: dotanuki-labs/github-actions/essentials@main | ||
with: | ||
file-patterns: '*.sh,*.rb,*.yml,*Dockerfile' | ||
license: 'mit' | ||
|
||
checks: | ||
runs-on: macOS-14 | ||
runs-on: ubuntu-22.04 | ||
needs: lint | ||
|
||
steps: | ||
- name: Project Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Run checks | ||
run: echo "✅ Passed!" | ||
|
||
- name: Run E2E tests | ||
run: ./e2e/run.sh |
File renamed without changes.
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,9 @@ | ||
# Copyright 2024 Dotanuki Labs | ||
# SPDX-License-Identifier: MIT | ||
|
||
FROM homebrew/brew:4.2.20 | ||
|
||
COPY . "/home/linuxbrew/dotanuki-taps" | ||
COPY e2e/tests.sh /usr/bin/tests.sh | ||
|
||
ENTRYPOINT ["/usr/bin/tests.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,24 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2024 Dotanuki Labs | ||
# SPDX-License-Identifier: MIT | ||
|
||
set -euo pipefail | ||
|
||
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
cd "${dir%/*}" | ||
|
||
echo | ||
echo "🔥 Building Docker image for tests!" | ||
echo | ||
|
||
docker build . -t dotanuki-labs/homebrew-taps -f e2e/Dockerfile | ||
|
||
echo | ||
echo "🔥 Running tests" | ||
echo | ||
|
||
docker run --rm dotanuki-labs/homebrew-taps | ||
|
||
echo | ||
echo "✅ Done!" | ||
echo |
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,43 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2024 Dotanuki Labs | ||
# SPDX-License-Identifier: MIT | ||
|
||
set -euo pipefail | ||
|
||
export HOMEBREW_NO_AUTO_UPDATE=1 | ||
export HOMEBREW_NO_ENV_HINTS=1 | ||
export HOMEBREW_NO_ANALYTICS=1 | ||
export HOMEBREW_NO_INSTALL_UPGRADE=1 | ||
|
||
tap_formulas() { | ||
brew tap dotanuki-labs/tap "/home/linuxbrew/dotanuki-taps" | ||
|
||
echo | ||
echo "Checking formulae collection" | ||
echo | ||
brew tap-info dotanuki-labs/tap | ||
echo | ||
} | ||
|
||
test_formula() { | ||
local name="$1" | ||
local url="$2" | ||
|
||
echo | ||
echo "Installing $name ($url)" | ||
brew install "$name" | ||
|
||
echo | ||
echo "Testing installation ($name) --help" | ||
echo | ||
"$name" --help | ||
|
||
echo | ||
} | ||
|
||
tap_formulas | ||
test_formula "gwv" "https://github.com/dotanuki-labs/gradle-wrapper-validator" | ||
|
||
echo | ||
echo "🔥 Done!" | ||
echo |
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,43 @@ | ||
# Copyright 2024 Dotanuki Labs | ||
# SPDX-License-Identifier: MIT | ||
|
||
class Gwv < Formula | ||
desc "A validator for gradle/wrapper jar binaries, intended to be used in CI pipelines" | ||
homepage "https://github.com/dotanuki-labs/gradle-wrapper-validator" | ||
version "0.2.0" | ||
|
||
os = OS.mac? ? "apple-darwin" : "unknown-linux-gnu" | ||
arch = case Hardware::CPU.arch | ||
when :x86_64 then "x86_64" | ||
when :arm64 then "aarch64" | ||
else | ||
raise "gorush: Unsupported system architecture #{Hardware::CPU.arch}" | ||
end | ||
|
||
@@filename = "gwv-#{arch}-#{os}" | ||
@@url = "#{homepage}/releases/download/#{version}/#{@@filename}" | ||
@@using = :nounzip | ||
|
||
@@sha256 = case "#{arch}-#{os}" | ||
when "x86_64-unknown-linux-gnu" then "ad4d81bd7f30a2a05e65313ec273139f24b260fb343f94abbdc02fdc4cd7585e" | ||
when "x86_64-apple-darwin" then "d975f93599b17829d6b016d54163db657be7899215869756501df38c513d86a8" | ||
when "aarch64-unknown-linux-gnu" then "1c0248acc279b5dbc4cf8776016dfc4d39f243902bc1544d59f06d91e9d93dc8" | ||
when "aarch64-apple-darwin" then "3ab1d6eef8e48fd3697f9f4cf535a106e46f7e530982ab324779bada3fca9921" | ||
else | ||
raise "gwv: Unsupported combination (arch / operating system) #{arch}-#{os}" | ||
end | ||
|
||
sha256 @@sha256 | ||
url @@url, | ||
using: @@using | ||
|
||
|
||
def install | ||
filename = Gwv.class_variable_get("@@filename") | ||
bin.install filename => "gwv" | ||
end | ||
|
||
test do | ||
system "#{bin}/gwv", "--version" | ||
end | ||
end |