Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI #60

Merged
merged 3 commits into from
Jan 21, 2022
Merged

CI #60

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 0 additions & 73 deletions .circleci/config.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: brew pr-pull
on:
pull_request_target:
types:
- labeled
jobs:
pr-pull:
if: contains(github.event.pull_request.labels.*.name, 'pr-pull')
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Set up git
uses: Homebrew/actions/git-user-config@master

- name: Pull bottles
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }}
HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }}
PULL_REQUEST: ${{ github.event.pull_request.number }}
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST

- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ github.token }}
branch: main

- name: Delete branch
if: github.event.pull_request.head.repo.fork == false
env:
BRANCH: ${{ github.event.pull_request.head.ref }}
run: git push --delete origin $BRANCH
45 changes: 45 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: brew test-bot
on:
push:
branches:
- main
- master
pull_request:
jobs:
test-bot:
strategy:
matrix:
os: [ubuntu-latest, macos-10.15, macos-11]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v1
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-

- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems

- run: brew test-bot --only-cleanup-before

- run: brew test-bot --only-setup

- run: brew test-bot --only-tap-syntax

- run: brew test-bot --only-formulae
if: github.event_name == 'pull_request'

- name: Upload bottles as artifact
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@main
with:
name: bottles
path: '*.bottle.*'
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

15 changes: 8 additions & 7 deletions archdefs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ class Archdefs < Formula
homepage "https://github.com/ralna/ARCHDefs/wiki"
url "https://github.com/ralna/ARCHDefs/archive/v2.0.3.tar.gz"
sha256 "f57f7c2912187c60a988c5a5707bce783ff93d414a46dd1dc51657a4bba54fbe"
revision 1

head "https://github.com/ralna/ARCHDefs.git"

keg_only "this formula only installs data files"
Expand All @@ -22,20 +24,19 @@ def install
if ENV["CUTEST_GFORTRAN"]
inreplace "compiler.#{mach}.#{arch}.gfo", "FORTRAN='gfortran'", "FORTRAN=#{ENV["CUTEST_GFORTRAN"]}"
end
if ENV["CUTEST_GCC"]
inreplace "ccompiler.#{mach}.#{arch}.gcc", "CC=gcc", "CC=#{ENV["CUTEST_GCC"]}"
end
inreplace "ccompiler.#{mach}.#{arch}.gcc", "CC=gcc", "CC=#{ENV["CUTEST_GCC"]}" if ENV["CUTEST_GCC"]

libexec.install Dir["ccompiler*"], Dir["compiler*"], Dir["system*"]
Pathname.new("#{prefix}/archdefs.bashrc").write <<~EOF
export ARCHDEFS=#{opt_libexec}
EOF
end

def caveats; <<~EOS
In your ~/.bashrc, add the line
. #{prefix}/archdefs.bashrc
EOS
def caveats
<<~EOS
In your ~/.bashrc, add the line
. #{prefix}/archdefs.bashrc
EOS
end

test do
Expand Down
3 changes: 3 additions & 0 deletions audit_exceptions/flat_namespace_allowlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"gsl@1"
]
27 changes: 12 additions & 15 deletions cutest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ class Cutest < Formula
homepage "https://github.com/ralna/CUTEst/wiki"
url "https://github.com/ralna/CUTEst/archive/v2.0.2.tar.gz"
sha256 "16ff35ff5956dfc6715250a26f7e5fa171b166fea5a60aeee2d6e232b22de954"
revision 1

head "https://github.com/ralna/CUTEst.git"

option "with-matlab", "Compile with Matlab support"
option "with-pgi", "build with Portland Group compilers"
option "without-single", "Compile without single support"

# We still require :fortran to create shared libraries. The options
# -all_load and -noall_load don't sit well with pgfortran.
depends_on "gcc"

depends_on "optimizers/cutest/archdefs"
depends_on "optimizers/cutest/gsl@1"
depends_on "optimizers/cutest/sifdecode" => (build.with?("pgi") ? ["with-pgi"] : [])
depends_on "optimizers/cutest/sifdecode"
env :std

patch :DATA
Expand All @@ -26,13 +25,11 @@ def install
single = build.with?("single") ? "y" : "n"
precisions = build.with?("single") ? ["single", "double"] : ["double"]

opoo "Portland Group compilers are not officially compatible with Matlab" if build.with?("matlab") && build.with?("pgi")

if OS.mac?
machine, key = Hardware::CPU.is_64_bit? ? %w[mac64 13] : %w[mac 12]
arch = "osx"
fcomp = build.with?("pgi") ? "5" : "2"
ccomp = build.with?("pgi") ? "6" : "5"
fcomp = "2"
ccomp = "5"
Pathname.new("cutest.input").write <<~EOF
#{key}
#{fcomp}
Expand All @@ -43,8 +40,8 @@ def install
else
machine = "pc64"
arch = "lnx"
fcomp = build.with?("pgi") ? "7" : "4"
ccomp = build.with?("pgi") ? "6" : "7"
fcomp = "5"
ccomp = "7"
Pathname.new("cutest.input").write <<~EOF
6
2
Expand All @@ -71,7 +68,7 @@ def install
noall_load = "-Wl,-no-whole-archive"
extra = []
end
compiler = build.with?("pgi") ? "pgf" : "gfo"
compiler = "gfo"
precisions.each do |prec|
cd "objects/#{machine}.#{arch}.#{compiler}/#{prec}" do
Dir["*.a"].each do |l|
Expand All @@ -97,7 +94,8 @@ def install
ln_sf "#{libexec}/objects/#{machine}.#{arch}.#{compiler}/double/libcutest_double.#{so}", "#{lib}/libcutest.#{so}"
if build.with? "single"
ln_sf "#{libexec}/objects/#{machine}.#{arch}.#{compiler}/single/libcutest.a", "#{lib}/libcutest_single.a"
ln_sf "#{libexec}/objects/#{machine}.#{arch}.#{compiler}/single/libcutest_single.#{so}", "#{lib}/libcutest_single.#{so}"
ln_sf "#{libexec}/objects/#{machine}.#{arch}.#{compiler}/single/libcutest_single.#{so}",
"#{lib}/libcutest_single.#{so}"
end

s = <<~EOS
Expand Down Expand Up @@ -148,7 +146,6 @@ def caveats
system "#{bin}/runcutest", "-p", pkg, "-sp", "-D", "ROSENBR.SIF" if build.with? "single"
end
end
ohai "Test results are in ~/Library/Logs/Homebrew/cutest."
end
end

Expand All @@ -160,11 +157,11 @@ def caveats
@@ -372,8 +372,8 @@ if [[ -e $CUTEST/versions/$VERSION ]]; then
[[ $? == 0 ]] && exit 4
fi

-MATLABGCC="gcc-4.3"
-MATLABGFORTRAN="gfortran-4.3"
+MATLABGCC="gcc"
+MATLABGFORTRAN="gfortran"
matlab=""

#echo $CMP
1 change: 1 addition & 0 deletions [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class GslAT1 < Formula
url "https://ftp.gnu.org/gnu/gsl/gsl-1.16.tar.gz"
mirror "https://ftpmirror.gnu.org/gsl/gsl-1.16.tar.gz"
sha256 "73bc2f51b90d2a780e6d266d43e487b3dbd78945dd0b04b14ca5980fe28d2f53"
revision 1

keg_only :versioned_formula

Expand Down
19 changes: 6 additions & 13 deletions maros_meszaros.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# CCPForge requires that svn checkouts be done with --username anonymous.
# This should be available in Homebrew by default in the near future.

class AnonymousSubversionDownloadStrategy < SubversionDownloadStrategy
def quiet_safe_system(*args)
super(*args + ["--username", "anonymous"])
end
end

class MarosMeszaros < Formula
desc "Maros and Meszaros SIF problems"
homepage "http://www.cuter.rl.ac.uk/Problems/marmes.shtml"
url "https://github.com/optimizers/maros-meszaros-mirror/archive/v0.1.tar.gz"
sha256 "eddc5e831f14be08e823d464ccb78834ef9e9120211f00f7724c0258c64fc14c"
head "https://ccpforge.cse.rl.ac.uk/svn/cutest/marosmeszaros/trunk", :using => AnonymousSubversionDownloadStrategy
homepage "https://bitbucket.org/optrove/maros-meszaros"
url "https://bitbucket.org/optrove/maros-meszaros/get/v0.1.tar.gz"
sha256 "4ac6b28429c22b87a8ab402a7927698220df575cf9b8966f436f0d82c3ccca16"
revision 1

head "https://[email protected]/optrove/maros-meszaros.git"

keg_only "this formula only installs data files"

Expand Down
12 changes: 7 additions & 5 deletions mastsif.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ class Mastsif < Formula
homepage "https://bitbucket.org/optrove/sif"
url "https://bitbucket.org/optrove/sif/get/v0.5.tar.gz"
sha256 "d2a7e0956e5216a4ad2a51a3a8219711e5f4f729cb3f044d4133d8fb19d0172d"
head "https://bitbucket.org/optrove/sif.git"
revision 1

head "https://bitbucket.org/optrove/sif.git"

keg_only "this formula only installs data files"

def install
Expand All @@ -15,10 +16,11 @@ def install
EOF
end

def caveats; <<~EOS
In your ~/.bashrc, add the line
. #{prefix}/mastsif.bashrc
EOS
def caveats
<<~EOS
In your ~/.bashrc, add the line
. #{prefix}/mastsif.bashrc
EOS
end

test do
Expand Down
9 changes: 5 additions & 4 deletions netlib.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class Netlib < Formula
desc "All NETLIB SIF problems"
homepage "http://www.cuter.rl.ac.uk/Problems/netlib.shtml"
url "https://bitbucket.org/optrove/netlib-lp/get/v0.1.tar.bz2"
sha256 "b24eb91097ef073ff66c7c6e20b213bfe8b1be6f5dcdb5cb7de38ebc44c77f88"
revision 1
homepage "https://bitbucket.org/optrove/netlib-lp"
url "https://bitbucket.org/optrove/netlib-lp/get/v0.1.tar.gz"
sha256 "e5b7d4128a0bde757ac59182228f80a33828ccc62c1764a33de722b096c0dd9a"
revision 2

head "https://bitbucket.org/optrove/netlib-lp.git"

keg_only "this formula only installs data files"
Expand Down
Loading