diff --git a/.github/workflows/mcstas-autobuild.yml b/.github/workflows/mcstas-autobuild.yml new file mode 100644 index 0000000000..fa182e4297 --- /dev/null +++ b/.github/workflows/mcstas-autobuild.yml @@ -0,0 +1,90 @@ +name: mcstas-autobuild +on: + schedule: + - cron: '50 23 * * *' # 23:50 every day + + workflow_dispatch: + inputs: + manual-debugging: + type: boolean + description: Launch manual debugging tmate for inspection (automatic in case of errors) + default: false + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: +# - { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8' } +# - { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.9' } + - { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.11' } +# - { os: ubuntu-latest, CC: clang, CXX: clang++, python: '3.11' } +# - { os: ubuntu-latest, CC: gcc-12, CXX: g++-12, python: '3.11' } +# - { os: macos-11, CC: clang, CXX: clang++, python: "3.10" } + - { os: macos-12, CC: clang, CXX: clang++, python: "3.11" } +# - { os: macos-13, CC: clang, CXX: clang++, python: "3.11" } +# - { os: windows-latest, CC: gcc, CXX: g++, python: "3.11" } +# - { os: windows-2019, CC: gcc, CXX: g++, python: "3.11" } + + name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }} + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: McCode + + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Setup build-deps + id: setup-build-deps + run: | + if [ "$RUNNER_OS" == "Linux" ]; then sudo apt-get -y install equivs ; fi + + - name: Check versions + id: version-checks + run: | + which python3 + python3 --version + which cmake + cmake --version + #NB: bison and flex in path are actually too old, on mac we + #inject these via a brew keg later + + - name: Build McStas + id: mcstas-build + run: | + if [ "$RUNNER_OS" == "macOS" ]; then export SDKROOT=$(xcrun --sdk macosx --show-sdk-path); fi + set -e + set -u + set -x + cd McCode + export REV=`date +%Y-%m-%d` + if [ "$RUNNER_OS" == "macOS" ]; then ./buildscripts/build_macos_mcstas ${REV}; fi + if [ "$RUNNER_OS" == "Linux" ]; then ./buildscripts/build_debs_mcstas ${REV} meta; fi + tar cfz dist-${RUNNER_OS}.tgz dist/ + + - name: 'Upload Artifact' + id: tar-upload + uses: actions/upload-artifact@v3 + if: always() + with: + name: mcstas-artefacts + path: "McCode/dist-*.tgz" + + - name: Setup tmate session for manual debugging + uses: mxschmitt/action-tmate@v3 + if: always() && (inputs.manual-debugging == true && steps.tar-package.outcome != 'success') + with: + limit-access-to-actor: true diff --git a/.github/workflows/mcxtrace-autobuild.yml b/.github/workflows/mcxtrace-autobuild.yml new file mode 100644 index 0000000000..9f3c9de2e0 --- /dev/null +++ b/.github/workflows/mcxtrace-autobuild.yml @@ -0,0 +1,90 @@ +name: mcxtrace-autobuild +on: + schedule: + - cron: '50 23 * * *' # 23:50 every day + + workflow_dispatch: + inputs: + manual-debugging: + type: boolean + description: Launch manual debugging tmate for inspection (automatic in case of errors) + default: false + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: +# - { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8' } +# - { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.9' } + - { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.11' } +# - { os: ubuntu-latest, CC: clang, CXX: clang++, python: '3.11' } +# - { os: ubuntu-latest, CC: gcc-12, CXX: g++-12, python: '3.11' } +# - { os: macos-11, CC: clang, CXX: clang++, python: "3.10" } + - { os: macos-12, CC: clang, CXX: clang++, python: "3.11" } +# - { os: macos-13, CC: clang, CXX: clang++, python: "3.11" } +# - { os: windows-latest, CC: gcc, CXX: g++, python: "3.11" } +# - { os: windows-2019, CC: gcc, CXX: g++, python: "3.11" } + + name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }} + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.CC }} + CXX: ${{ matrix.CXX }} + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: McCode + + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Setup build-deps + id: setup-build-deps + run: | + if [ "$RUNNER_OS" == "Linux" ]; then sudo apt-get -y install equivs ; fi + + - name: Check versions + id: version-checks + run: | + which python3 + python3 --version + which cmake + cmake --version + #NB: bison and flex in path are actually too old, on mac we + #inject these via a brew keg later + + - name: Build McXtrace + id: mcxtrace-build + run: | + if [ "$RUNNER_OS" == "macOS" ]; then export SDKROOT=$(xcrun --sdk macosx --show-sdk-path); fi + set -e + set -u + set -x + cd McCode + export REV=`date +%Y-%m-%d` + if [ "$RUNNER_OS" == "macOS" ]; then ./buildscripts/build_macos_mcxtrace ${REV}; fi + if [ "$RUNNER_OS" == "Linux" ]; then ./buildscripts/build_debs_mcxtrace ${REV} meta; fi + tar cfz dist-${RUNNER_OS}.tgz dist/ + + - name: 'Upload Artifact' + id: tar-upload + uses: actions/upload-artifact@v3 + if: always() + with: + name: mcxtrace-artefacts + path: "McCode/dist-*.tgz" + + - name: Setup tmate session for manual debugging + uses: mxschmitt/action-tmate@v3 + if: always() && (inputs.manual-debugging == true && steps.tar-package.outcome != 'success') + with: + limit-access-to-actor: true