|
30 | 30 | TARGETS_OPTIONAL: ptest |
31 | 31 |
|
32 | 32 | jobs: |
33 | | - local-macos: |
| 33 | + stage-1: |
| 34 | + uses: ./.github/workflows/macos.yml |
| 35 | + with: |
| 36 | + stage: "1" |
34 | 37 |
|
35 | | - runs-on: ${{ matrix.os }} |
36 | | - strategy: |
37 | | - fail-fast: false |
38 | | - matrix: |
39 | | - stage: ["1", "2", "2-optional-0-o", "2-optional-p-z", "2-experimental-0-o", "2-experimental-p-z"] |
40 | | - # python3_xcode is only accepted if enough packages are available from the system |
41 | | - # --> to test "minimal", we would need https://github.com/sagemath/sage/issues/30949 |
42 | | - tox_env: [homebrew-macos-usrlocal-minimal, homebrew-macos-usrlocal-standard, homebrew-macos-usrlocal-maximal, homebrew-macos-usrlocal-python3_xcode-standard, conda-forge-macos-minimal, conda-forge-macos-standard, conda-forge-macos-maximal] |
43 | | - xcode_version_factor: [default] |
44 | | - os: [ macos-11, macos-12 ] |
45 | | - env: |
46 | | - TOX_ENV: local-${{ matrix.tox_env }} |
47 | | - LOCAL_ARTIFACT_NAME: sage-local-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}-${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }} |
48 | | - LOGS_ARTIFACT_NAME: logs-commit-${{ github.sha }}-tox-local-${{ matrix.tox_env }}--${{ matrix.os }}-xcode_${{ matrix.xcode_version_factor }} |
49 | | - steps: |
50 | | - - uses: actions/checkout@v4 |
51 | | - - name: Select Xcode version |
52 | | - run: | |
53 | | - if [ ${{ matrix.xcode_version_factor }} != default ]; then sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode_version_factor }}.app; fi |
54 | | - - name: Install test prerequisites |
55 | | - run: | |
56 | | - brew install tox |
57 | | - - uses: actions/download-artifact@v3 |
58 | | - with: |
59 | | - path: sage-local-artifact |
60 | | - name: ${{ env.LOCAL_ARTIFACT_NAME }} |
61 | | - if: contains(matrix.stage, '2') |
62 | | - - name: Extract sage-local artifact |
63 | | - # This is macOS tar -- cannot use --listed-incremental |
64 | | - run: | |
65 | | - export SAGE_LOCAL=$(pwd)/.tox/$TOX_ENV/local |
66 | | - .github/workflows/extract-sage-local.sh sage-local-artifact/sage-local-*.tar |
67 | | - if: contains(matrix.stage, '2') |
68 | | - - name: Build and test with tox |
69 | | - # We use a high parallelization on purpose in order to catch possible parallelization bugs in the build scripts. |
70 | | - # For doctesting, we use a lower parallelization to avoid timeouts. |
71 | | - run: | |
72 | | - case "${{ matrix.stage }}" in |
73 | | - 1) export TARGETS_PRE="all-sage-local" TARGETS="all-sage-local" TARGETS_OPTIONAL="build/make/Makefile" |
74 | | - ;; |
75 | | - 2) export TARGETS_PRE="all-sage-local" TARGETS="build doc-html" TARGETS_OPTIONAL="ptest" |
76 | | - ;; |
77 | | - 2-optional*) export TARGETS_PRE="build/make/Makefile" TARGETS="build/make/Makefile" |
78 | | - targets_pattern="${{ matrix.stage }}" |
79 | | - targets_pattern="${targets_pattern#2-optional-}" |
80 | | - export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && sage-package list :optional: --has-file 'spkg-install.in|spkg-install|requirements.txt' --no-file huge|has_nonfree_dependencies | grep -v sagemath_doc | grep "^[$targets_pattern]" ) ) |
81 | | - ;; |
82 | | - 2-experimental*) export TARGETS_PRE="build/make/Makefile" TARGETS="build/make/Makefile" |
83 | | - targets_pattern="${{ matrix.stage }}" |
84 | | - targets_pattern="${targets_pattern#2-experimental-}" |
85 | | - export TARGETS_OPTIONAL=$( echo $(export PATH=build/bin:$PATH && sage-package list :experimental: --has-file 'spkg-install.in|spkg-install|requirements.txt' --no-file huge|has_nonfree_dependencies | grep -v sagemath_doc | grep "^[$targets_pattern]" ) ) |
86 | | - ;; |
87 | | - esac |
88 | | - MAKE="make -j12" tox -e $TOX_ENV -- SAGE_NUM_THREADS=4 $TARGETS |
89 | | - - name: Prepare logs artifact |
90 | | - run: | |
91 | | - mkdir -p "artifacts/$LOGS_ARTIFACT_NAME"; cp -r .tox/*/log "artifacts/$LOGS_ARTIFACT_NAME" |
92 | | - if: always() |
93 | | - - uses: actions/upload-artifact@v3 |
94 | | - with: |
95 | | - path: artifacts |
96 | | - name: ${{ env.LOGS_ARTIFACT_NAME }} |
97 | | - if: always() |
98 | | - - name: Print out logs for immediate inspection |
99 | | - # and markup the output with GitHub Actions logging commands |
100 | | - run: | |
101 | | - .github/workflows/scan-logs.sh "artifacts/$LOGS_ARTIFACT_NAME" |
102 | | - if: always() |
103 | | - - name: Prepare sage-local artifact |
104 | | - # This also includes the copies of homebrew or conda installed in the tox environment. |
105 | | - # We use absolute pathnames in the tar file. |
106 | | - # This is macOS tar -- cannot use --remove-files. |
107 | | - # We remove the $SAGE_LOCAL/lib64 link, which will be recreated by the next stage. |
108 | | - run: | |
109 | | - mkdir -p sage-local-artifact && (cd .tox/$TOX_ENV && rm -f "local/lib64" && tar -cf - $(pwd)) > sage-local-artifact/sage-${{ env.TOX_ENV }}-${{ matrix.stage }}.tar |
110 | | - if: contains(matrix.stage, '1') |
111 | | - - uses: actions/upload-artifact@v3 |
112 | | - with: |
113 | | - path: sage-local-artifact/sage-${{ env.TOX_ENV }}-${{ matrix.stage }}.tar |
114 | | - name: ${{ env.LOCAL_ARTIFACT_NAME }} |
115 | | - if: always() |
| 38 | + stage-2: |
| 39 | + uses: ./.github/workflows/macos.yml |
| 40 | + with: |
| 41 | + stage: "2" |
| 42 | + needs: [stage-1] |
| 43 | + |
| 44 | + stage-2-optional-0-o: |
| 45 | + uses: ./.github/workflows/macos.yml |
| 46 | + with: |
| 47 | + stage: "2-optional-0-o" |
| 48 | + needs: [stage-2] |
| 49 | + |
| 50 | + stage-2-optional-p-z: |
| 51 | + uses: ./.github/workflows/macos.yml |
| 52 | + with: |
| 53 | + stage: "2-optional-p-z" |
| 54 | + needs: [stage-2-optional-0-o] |
| 55 | + |
| 56 | + stage-2-experimental-0-o: |
| 57 | + uses: ./.github/workflows/macos.yml |
| 58 | + with: |
| 59 | + stage: "2-optional-0-o" |
| 60 | + needs: [stage-2-optional-p-z] |
| 61 | + |
| 62 | + stage-2-experimental-p-z: |
| 63 | + uses: ./.github/workflows/macos.yml |
| 64 | + with: |
| 65 | + stage: "2-experimental-p-z" |
| 66 | + needs: [stage-2-experimental-0-o] |
116 | 67 |
|
117 | 68 | dist: |
118 | 69 |
|
|
0 commit comments