diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 22cd2440..1f97441c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-13, macos-12] + os: [macos-12] python-version: ["3.11"] runs-on: ${{ matrix.os }} steps: @@ -54,11 +54,14 @@ jobs: working-directory: tests run: | export PATH=$PATH:/Users/runner/work/gmtsar/gmtsar/GMTSAR/bin - # remove Google Colab specific commands - sed -i '' '/if \x27google\.colab\x27 in sys\.modules:/,/^$/d' imperial_valley_2015.py - sed -i '' 's/^[[:blank:]]*!.*$//' imperial_valley_2015.py ulimit -n 10000 - python3 imperial_valley_2015.py + # remove Google Colab specific commands and add __main__ section + cat imperial_valley_2015.py \ + | sed '/if \x27google\.colab\x27 in sys\.modules:/,/^$/d' \ + | sed 's/^[[:blank:]]*!.*$//' \ + | awk '/username = \x27GoogleColab2023\x27/ {print "if __name__ == \x27__main__\x27:"; indent=1} {if(indent) sub(/^/, " "); print}' \ + > imperial_valley_2015.fixed.py + python3 imperial_valley_2015.fixed.py - name: Archive test results uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 87401d02..c6ad6520 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -71,10 +71,13 @@ jobs: Xvfb :99 -screen 0 800x600x24 > /dev/null 2>&1 & export DISPLAY=:99 export XVFB_PID=$! - # remove Google Colab specific commands - sed -i '/if \x27google\.colab\x27 in sys\.modules:/,/^$/d' imperial_valley_2015.py - sed -i 's/^[[:blank:]]*!.*$//' imperial_valley_2015.py - python3 imperial_valley_2015.py + # remove Google Colab specific commands and add __main__ section + cat imperial_valley_2015.py \ + | sed '/if \x27google\.colab\x27 in sys\.modules:/,/^$/d' \ + | sed 's/^[[:blank:]]*!.*$//' \ + | awk '/username = \x27GoogleColab2023\x27/ {print "if __name__ == \x27__main__\x27:"; indent=1} {if(indent) sub(/^/, " "); print}' \ + > imperial_valley_2015.fixed.py + python3 imperial_valley_2015.fixed.py - name: Archive test results uses: actions/upload-artifact@v3 with: