Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add macos testing #85

Merged
merged 5 commits into from
Sep 12, 2022
Merged

[CI] Add macos testing #85

merged 5 commits into from
Sep 12, 2022

Conversation

samcunliffe
Copy link
Member

Got it working on 🍎 !

Thanks for @giordano 's top-tip to use this tmate action to help debugging.

Unfortunately it's yet another separate build with a YML file that is 90% the same as the Linux and Windows ones. But on the plus: we get another badge.

Good news: it found a genuine (minor) bug. 🐛

MacOS build test uncovered a true bug.
Had to update CMakeLists to get it to compile on Mac. Added a badge to
the README (because of course we need a badge).
@samcunliffe samcunliffe linked an issue Sep 7, 2022 that may be closed by this pull request
Copy link
Member

@t-young31 t-young31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍎 🚀

My only comment is: perhaps ~3h of CI time is a lot per run for this. I wonder if, like the Windows CI, we should just check a successful compile on pull_request (and run everything on push: main)

@t-young31 t-young31 added the technical Technical and meta issues, not related to physics but infrastructure. label Sep 8, 2022
@samcunliffe
Copy link
Member Author

🍎 🚀

My only comment is: perhaps ~3h of CI time is a lot per run for this. I wonder if, like the Windows CI, we should just check a successful compile on pull_request (and run everything on push: main)

Oh agreed. I didn't notice that the system tests were at ~35mins each. (Why so slow?)

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks overall ok to me (apart from the comments below), but I must say I'm thrilled about the idea of adding yet another build script which is for 75% identical to the linux one. I hadn't had the opportunity to comment about this when the Windows job was split out of the Linux one. My main problem is that changing the scripts in the future to, say, add one more step or use a different configuration option for CMake will require changing three different files. Yes, conditionals aren't great, but I think their ugliness is outweighed by the cost of keeping in sync three different files.

.github/workflows/macos_tests.yml Outdated Show resolved Hide resolved
.github/workflows/macos_tests.yml Outdated Show resolved Hide resolved
if: matrix.build_testing == 'ON'
working-directory: ${{runner.workspace}}/build
run: |
export OMP_NUM_THREADS=1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting OMP_NUM_THREADS manually in each step (and I'd use

        env:
          OMP_NUM_THREADS: 1

instead), I think you can also set the variable globally for the entire job. This has also the advantage of being shell-independent (not that on macOS specifically we'd use much different shells, but I'm thinking in the optic of unifying the build scripts).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tangential to this point: it may be nice to have a test e.g. just test_arc_01.py that runs with 2 threads, to test the parallelisation hasn't been broken?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. It could be done with an additional matrix entry, and then you can do

env:
  OMP_NUM_THREADS: ${{ matrix.num_threads }}

We do it for example at https://github.com/Team-RADDISH/ParticleDA.jl/blob/410605a29b17d2ec2f3e86848e62a4ab6ff73102/.github/workflows/ci.yml#L12-L13

Copy link
Member Author

@samcunliffe samcunliffe Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting OMP_NUM_THREADS manually in each step (and I'd use

        env:
          OMP_NUM_THREADS: 1

instead), I think you can also set the variable globally for the entire job. This has also the advantage of being shell-independent (not that on macOS specifically we'd use much different shells, but I'm thinking in the optic of unifying the build scripts).

Ah. This was just brainlessly copied over from the Windows one which was the starting point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. It could be done with an additional matrix entry, and then you can do

env:
  OMP_NUM_THREADS: ${{ matrix.num_threads }}

We do it for example at https://github.com/Team-RADDISH/ParticleDA.jl/blob/410605a29b17d2ec2f3e86848e62a4ab6ff73102/.github/workflows/ci.yml#L12-L13

I would do this in a separate issue/PR (to avoid snowballing). And let's do it to the linux tests (only)?

@samcunliffe samcunliffe deleted the add-macos-testing branch September 12, 2022 07:49
@samcunliffe samcunliffe restored the add-macos-testing branch September 12, 2022 07:50
@samcunliffe samcunliffe reopened this Sep 12, 2022
@samcunliffe samcunliffe merged commit 953a0a9 into UCL:main Sep 12, 2022
@samcunliffe samcunliffe deleted the add-macos-testing branch September 12, 2022 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical Technical and meta issues, not related to physics but infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a github action to build macos
3 participants