Skip to content

Commit

Permalink
Add workflow for build and test on OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-alexandrov committed Sep 25, 2023
1 parent cc46bf8 commit bc2dade
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo now in run_test.sh

mkdir -p ~/work/StereoPipeline/StereoPipeline-OSX

echo Created directory ~/work/StereoPipeline/StereoPipeline-OSX
touch ~/work/StereoPipeline/StereoPipeline-OSX/test.txt
echo Created file ~/work/StereoPipeline/StereoPipeline-OSX/test.txt
41 changes: 41 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build_test
on:
workflow_dispatch:

# Build and test ASP on macOS. For now triggered by hand.

# on:
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]

jobs:
build:

runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Cache conda
id: cache-conda
uses: actions/cache@v3
env:
cache-name: cache-conda
with:
# Use cached ASP dependencies. They will be created manually
# after starting a session with ssh.yml.
path: |
/usr/local/miniconda/envs
~/projects/StereoPipelineTest
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/miniconda.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: run_test
run: ./.github/workflows/build_test.sh
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: StereoPipeline_${{ matrix.os }}
path: ~/work/StereoPipeline/StereoPipeline-OSX
17 changes: 10 additions & 7 deletions .github/workflows/ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,30 @@ jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache conda
id: cache-conda
uses: actions/cache@v3
env:
cache-name: cache-conda
with:
## Cache the ASP dependencies. They will be created manually in
## the next step, after logging in to the upterm session,
## and the actual caching will happen when this recipe exits.
## Changes to the cache cannot be saved, so it should
## be wiped from the web interface if desired to recreate it.
path: |
/usr/local/miniconda/envs
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/miniconda.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup upterm session with ssh access
- name: Set up an upterm session with ssh access
uses: lhotari/action-upterm@v1
with:
## Testing ssh access to macos cloud machine
## limits ssh access and adds the ssh public key for the user which triggered the workflow
## Limit access to specified users
limit-access-to-actor: true
## limits ssh access and adds the ssh public keys of the listed GitHub users
limit-access-to-users: oleg-alexandrov
## If no one connects after 5 minutes, shut down server.
wait-timeout-minutes: 5
## If no one connects after 5 minutes, shut down the server
wait-timeout-minutes: 5

0 comments on commit bc2dade

Please sign in to comment.