-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test mac on self-hosted runner (#334)
* Test on self-hosted mac * Automatically add pipx apps to PATH * Test all MLIPs on mac * Remove pipx and poetry installation * Fix poetry path * Update MacOS ci for uv * Fix coveralls * Update docs for self-hosted runners
- Loading branch information
1 parent
6c4154e
commit bf53f87
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: mac-ci | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
tests: | ||
runs-on: [self-hosted, macOS] | ||
if: github.repository == 'stfc/janus-core' | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
python-version: ['3.9','3.10','3.11','3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: "0.5.7" | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: uv sync --all-extras | ||
|
||
- name: Run test suite | ||
env: | ||
# show timings of tests | ||
PYTEST_ADDOPTS: "--durations=0" | ||
run: uv run pytest --run-extra-mlips --cov janus_core --cov-append . | ||
|
||
- name: Set Path | ||
run: | | ||
source ~/.zshrc | ||
echo "PATH=$PATH" >> $GITHUB_ENV | ||
- name: Report coverage to Coveralls | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel: true | ||
flag-name: run-${{ matrix.python-version }} | ||
file: coverage.xml | ||
base-path: janus_core | ||
|
||
coverage: | ||
needs: tests | ||
runs-on: self-hosted | ||
steps: | ||
- name: Close parallel build | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel-finished: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
====================== | ||
Continuous Integration | ||
====================== | ||
|
||
General instructions for setting up self-hosted GitHub runners can be found `here <https://docs.github.com/en/actions/hosting-your-own-runners>`_. | ||
|
||
This process typically involves: | ||
|
||
1. Add a new self-hosted runner on GitHub | ||
2. Run instructions from GitHub on your runner to download and configure | ||
3. Ensure tags added to the runner are unique, and match those in ``runs-on`` within the CI workflow | ||
|
||
|
||
MacOS self-hosted runner | ||
======================== | ||
|
||
Currently, ``janus-core`` uses a self-hosted runner to run all unit tests on MacOS. | ||
|
||
To ensure the self-hosted runner remains active, we currently recommend using | ||
|
||
.. code-block:: bash | ||
nohup ./run.sh &! | ||
This runs the script in the background, and disowns the process, allowing the ssh connection to be ended without killing the process. | ||
|
||
It would be preferable to `configure the runner application as a service <https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/configuring-the-self-hosted-runner-application-as-a-service?platform=mac>`_, | ||
but currently this appears to lead to difficulties if the GUI is not active | ||
and/or ``sudo`` permissions are not used in running the service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ Developer guide | |
|
||
get_started | ||
tutorial | ||
ci |