diff --git a/.github/workflows/macWF.yml b/.github/workflows/macWF.yml index c6fc3bda30..48be345a1c 100644 --- a/.github/workflows/macWF.yml +++ b/.github/workflows/macWF.yml @@ -20,11 +20,10 @@ jobs: # see https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 for possible exclusions matrix: variant: [ "" , "+allmodules" ] - # this is to test both intel and arm64 macs - # note: macos-14 has a problem in fetching the git repository of plumed, namely a - # "fatal: detected dubious ownership in repository" error - # I didn't find any solution, so for the moment I keep macos-14 off - os: [ macos-13 ] + # macos-15 (arm runner) fails with "Failed to open statefile for plumed: + # Could not open file: .../plumed2/plumed2/macports/science/plumed/Portfile" + # so we only run on intel macs for now + os: [macos-15-intel] exclude: # many tests on contributed modules are still failing for numerical reasons on arm64, see https://github.com/plumed/plumed2/pull/950 # once fixed we could introduce this back: @@ -57,6 +56,12 @@ jobs: sudo port -N install $p-plumed done source ./macports-ci ccache --save + - name: show logs + if: always() + run: | + cat /opt/local/var/macports/logs/_Users_runner_work_plumed2_plumed2_macports_science_plumed/plumed/main.log + cat /opt/local/var/macports/logs/_Users_runner_work_plumed2_plumed2_macports_python_py-plumed/py39-plumed/main.log + - name: Run tests run: | sudo port -N -d test plumed ${{ matrix.variant }} @@ -71,7 +76,7 @@ jobs: fail-fast: false matrix: # this is to test both intel and arm64 macs - os: [ macos-13 , macos-14 ] + os: [macos-15-intel, macos-15] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2bb42a34e8..188ea77702 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,5 +1,5 @@ name: Nightly builds -on: +on: schedule: - cron: "30 17 * * 0" @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest , macos-13 , macos-14] + os: [ubuntu-latest, macos-15-intel, macos-15] branch: [v2.8, v2.9, master] runs-on: ${{ matrix.os }} steps: diff --git a/macports/.gitignore b/macports/.gitignore index 5eb6dfb663..c492787462 100644 --- a/macports/.gitignore +++ b/macports/.gitignore @@ -1 +1,2 @@ /science +/python diff --git a/macports/generate-portfile.sh b/macports/generate-portfile.sh index 379647cb64..b6b40595ea 100755 --- a/macports/generate-portfile.sh +++ b/macports/generate-portfile.sh @@ -3,6 +3,8 @@ # This script generates a Portfile in science/plumed # Currently the portfile is aimed at testing the currect git hash +alias awk=gawk + prefix= if git describe --exact-match --tags HEAD 2>/dev/null 1>/dev/null then @@ -17,11 +19,26 @@ else fi if test -n "$plumed_repository" ; then -# get this from environment - repository="$plumed_repository" + fetch="fetch.type git\n" + # get this from environment + fetch+="git.url $plumed_repository\n" + # notice that if instead of hashtag we want to put a version, then it should be + # git.branch v${version} + fetch+="git.branch $prefix$version\n" else -# parent directory: + # parent directory: repository="${PWD%/*}" + + # use a pre-fetch step to copy the sources + fetch="fetch.type none\n\n" + fetch+="pre-fetch {\n" + fetch+=" ui_msg \"Using local source tree\"\n" + fetch+=" set local_repo \"$repository\"\n" + fetch+=" system \"rm -rf \${workpath}/localsrc\"\n" + fetch+=" system \"cp -a \${local_repo} \${workpath}/localsrc\"\n" + fetch+=" return 0\n" + fetch+="}\n\n" + fetch+="worksrcdir \"\${workpath}/localsrc\"\n" fi mkdir -p science/plumed @@ -36,15 +53,8 @@ cat Portfile.in | sed " s/@_VERSION_@/$version/ s/@_REVISION_@/0/ -" | awk '{ - if($1=="@_FETCH_@"){ - print "fetch.type git" - print "git.url '$repository'" -# notice that if instead of hashtag we want to put a version, then it should be -# git.branch v${version} - print "git.branch '$prefix'${version}" - } else print -}' | awk -v modules="$modules" '{ + s|@_FETCH_@|$fetch| +" | awk -v modules="$modules" '{ if($1=="@_MODULES_@"){ var=$2 split(modules,list); @@ -91,17 +101,5 @@ cat PortfilePython.in | sed " s/@_VERSION_@/$version/ s/@_REVISION_@/0/ -" | awk '{ - if($1=="@_FETCH_@"){ - print "fetch.type git" - print "git.url '$repository'" -# notice that if instead of hashtag we want to put a version, then it should be -# git.branch v${version} - print "git.branch '$prefix'${version}" - } else print -}' > python/py-plumed/Portfile - - - - - + s|@_FETCH_@|$fetch| +" > python/py-plumed/Portfile