|
| 1 | +name: Build & test gsas2new self-installer on RHEL |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | + workflow_dispatch: # nice for debugging |
| 7 | + |
| 8 | + push: |
| 9 | + branches: [ "main" ] |
| 10 | + paths: # want this to run only when files relevant to |
| 11 | + # package build change |
| 12 | + - install/gitcompile.py |
| 13 | + - install/GSAS2new/* |
| 14 | + |
| 15 | + #repository_dispatch: # TODO: launch from GSASII repo via Web API |
| 16 | + |
| 17 | +jobs: |
| 18 | + build: |
| 19 | + name: gsas2new build on RHEL |
| 20 | + runs-on: self-hosted |
| 21 | + steps: |
| 22 | + - name: test connection |
| 23 | + shell: bash -l {0} |
| 24 | + run: | |
| 25 | + cd /local |
| 26 | + ls |
| 27 | + |
| 28 | + # - name: Checkout |
| 29 | + # uses: actions/checkout@v4 |
| 30 | + |
| 31 | + # - name: Set up conda # versions here are not tied to what is used for package or installer |
| 32 | + # #uses: conda-incubator/[email protected] |
| 33 | + # uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3 using hash for security |
| 34 | + # with: |
| 35 | + # activate-environment: build |
| 36 | + # environment-file: install/GSAS2new/conda-minbuild.yml |
| 37 | + # miniforge-version: latest |
| 38 | + |
| 39 | + # - name: regress conda or conda-standalone on Windows |
| 40 | + # if: inputs.os == 'windows-latest' |
| 41 | + # shell: bash -l {0} |
| 42 | + # run: | |
| 43 | + # # regress conda or conda-standalone on Windows until constructor 3.11.2 is out |
| 44 | + # # do this here so it is not buried in the .yml |
| 45 | + # #conda install constructor=3.11.2 |
| 46 | + # #conda install constructor=3.9 |
| 47 | + # conda install conda-standalone=24.9.2 # works with constructor 3.11.1 |
| 48 | + |
| 49 | + # - name: create gsas2new conda package |
| 50 | + # shell: bash -l {0} |
| 51 | + # run: | |
| 52 | + # cd install |
| 53 | + # if [ "$RUNNER_OS" == "Windows" ]; then |
| 54 | + # echo "Windows build" |
| 55 | + # python GSAS2new/makeBldFiles.py |
| 56 | + # conda config --set anaconda_upload yes |
| 57 | + # conda build GSAS2new --output-folder C:/tmp/builds --user briantoby --token ${{ secrets.ANACONDA_TOKEN }} |
| 58 | + # else |
| 59 | + # echo "Unix build" |
| 60 | + # python GSAS2new/makeBldFiles.py |
| 61 | + # conda build GSAS2new --output-folder ~/build # use below due to patch above |
| 62 | + # #conda build GSAS2new --output-folder ~/build --package-format .conda |
| 63 | + # anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload ~/build/*/*.conda --user briantoby --force |
| 64 | + # fi |
| 65 | + |
| 66 | + # - name: create gsas2new self-installer |
| 67 | + # shell: bash -l {0} |
| 68 | + # run: | |
| 69 | + # cd install |
| 70 | + # constructor GSAS2new |
| 71 | + # #conda list |
| 72 | + |
| 73 | + # # Now have a gsas2new-####-<platform>.sh/.exe |
| 74 | + # # file in install dir, dup with name as -Latest- |
| 75 | + # - name: duplicate upload on Unixes |
| 76 | + # shell: bash -l {0} |
| 77 | + # if: inputs.os != 'windows-latest' |
| 78 | + # run: | |
| 79 | + # cd install |
| 80 | + # cp -v *.sh `ls gsas2new-*.sh | sed -e s/-[0-9]*-/-Latest-/` |
| 81 | + # - name: duplicate on Windows |
| 82 | + # if: inputs.os == 'windows-latest' |
| 83 | + # run: copy install/*.exe install/gsas2new-Latest-Windows-x86_64.exe |
| 84 | + |
| 85 | + # # Now have above and gsas2new-Latest-<platform>.sh/.exe |
| 86 | + # # file in install. Upload to the Assets area: |
| 87 | + # # https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/releases/latest |
| 88 | + # # |
| 89 | + # - name: Release on Unix |
| 90 | + # uses: softprops/action-gh-release@v2 |
| 91 | + # if: inputs.os != 'windows-latest' |
| 92 | + # with: |
| 93 | + # files: install/*.sh |
| 94 | + # tag_name: v1.0.1 |
| 95 | + # - name: Release on Windows |
| 96 | + # uses: softprops/action-gh-release@v2 |
| 97 | + # if: inputs.os == 'windows-latest' |
| 98 | + # with: |
| 99 | + # files: install/*.exe |
| 100 | + # tag_name: v1.0.1 |
| 101 | + |
| 102 | + # # start testing |
| 103 | + # job2: |
| 104 | + # name: test on ${{ inputs.os }} |
| 105 | + # runs-on: ${{ inputs.os }} |
| 106 | + # needs: build |
| 107 | + # steps: |
| 108 | + |
| 109 | + # - uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0 |
| 110 | + # if: runner.os == 'Windows' |
| 111 | + # id: downloadfile |
| 112 | + # with: |
| 113 | + # url: "https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/releases/download/v1.0.1/gsas2new-Latest-Windows-x86_64.exe" |
| 114 | + # #target: download/ |
| 115 | + # - name: GSAS-II install Windows |
| 116 | + # if: runner.os == 'Windows' |
| 117 | + # shell: pwsh |
| 118 | + # run: Start-Process -FilePath .\gsas2new-Latest-Windows-x86_64.exe -ArgumentList "/S /AddToPath=1 " -NoNewWindow -Wait |
| 119 | + |
| 120 | + # - name: GSAS-II all tests, Windows |
| 121 | + # if: runner.os == 'Windows' |
| 122 | + # shell: cmd |
| 123 | + # run: | |
| 124 | + # call C:\ProgramData\gsas2new\Scripts\activate |
| 125 | + # call conda install --quiet -y pytest |
| 126 | + # python -m pytest C:/ProgramData/gsas2new/GSAS-II |
| 127 | + |
| 128 | + # # GSAS-II install & test Linux/Mac |
| 129 | + # - name: download, install G2, pytest & test on unixes |
| 130 | + # if: runner.os != 'Windows' |
| 131 | + # shell: bash |
| 132 | + # run: | |
| 133 | + # if [ "${{ inputs.os }}" == "ubuntu-latest" ]; then |
| 134 | + # dfil="gsas2new-Latest-Linux-x86_64.sh" |
| 135 | + # elif [ "${{ inputs.os }}" == "macos-13" ]; then |
| 136 | + # dfil="gsas2new-Latest-MacOSX-x86_64.sh" |
| 137 | + # elif [ "${{ inputs.os }}" == "macos-14" ]; then |
| 138 | + # dfil="gsas2new-Latest-MacOSX-arm64.sh" |
| 139 | + # else |
| 140 | + # dfil="?" |
| 141 | + # fi |
| 142 | + # curl -s -L -o /tmp/${dfil} https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/releases/download/v1.0.1/${dfil} |
| 143 | + # bash /tmp/${dfil} -p /tmp/gsas2new -b |
| 144 | + # source /tmp/gsas2new/bin/activate |
| 145 | + # conda install --quiet -y pytest |
| 146 | + # source /tmp/gsas2new/bin/activate |
| 147 | + # cd /tmp/gsas2new/GSAS-II |
| 148 | + # python -m pytest |
0 commit comments