|
| 1 | +# This workflow will install Python dependencies, the supported rail packages, and run the create_interactive_structure.py script |
| 2 | +# If it fails with exit code = 2, that means that there have been updates to any of the stages |
| 3 | +# this usually means that you just need to create a new branch, run create_interactive_structure.py and do a PR with rail_base to update the .pyi |
| 4 | +# stub files |
| 5 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 6 | + |
| 7 | +name: Running create_interactive_structure script |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: [ main ] |
| 12 | + pull_request: |
| 13 | + branches: [ main ] |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + python-version: ['3.10', '3.11', '3.12'] |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v3 |
| 24 | + with: |
| 25 | + fetch-tags: true |
| 26 | + fetch-depth: 0 |
| 27 | + - name: Set up Python ${{ matrix.python-version }} |
| 28 | + uses: actions/setup-python@v4 |
| 29 | + with: |
| 30 | + python-version: ${{ matrix.python-version }} |
| 31 | + - name: System deps (MPI + build) |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install -y --no-install-recommends \ |
| 35 | + build-essential libbz2-dev \ |
| 36 | + openmpi-bin libopenmpi-dev |
| 37 | + - name: Install dependencies |
| 38 | + run: | |
| 39 | + # sudo apt-get update |
| 40 | + # python -m pip install --upgrade pip |
| 41 | + python -m pip install --upgrade pip setuptools wheel |
| 42 | + python -m pip install "numpy<2" cython |
| 43 | + python -m pip install --upgrade --no-binary=mpi4py mpi4py |
| 44 | + python -m pip install --no-build-isolation somoclu |
| 45 | + python -m pip install --upgrade pip |
| 46 | + pip install wheel numpy |
| 47 | + pip install . |
| 48 | + pip install .[dev] |
| 49 | + pip install .[algos] |
| 50 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 51 | +
|
| 52 | + # runs the create interactive structure test to see if the interactive structure needs to be changed |
| 53 | + # returns a 1 if something went wrong with the script, or a 2 if the files need to be changed |
| 54 | + - name: Run create_interactive_structure.py |
| 55 | + run: | |
| 56 | + python create_interactive_structure.py |
| 57 | + - name: Send status to Slack app (RAIL CI Reporter) |
| 58 | + if: ${{ failure() && github.event_name != 'workflow_dispatch' }} |
| 59 | + id: slack |
| 60 | + uses: slackapi/slack-github-action@v1.24.0 |
| 61 | + with: |
| 62 | + # For posting a rich message using Block Kit |
| 63 | + payload: | |
| 64 | + { |
| 65 | + "blocks": [ |
| 66 | + { |
| 67 | + "type": "header", |
| 68 | + "text": { |
| 69 | + "type": "plain_text", |
| 70 | + "text": "${{ github.repository }} create_interactive_structure workflow" |
| 71 | + } |
| 72 | + }, |
| 73 | + { |
| 74 | + "type": "section", |
| 75 | + "text": { |
| 76 | + "type": "mrkdwn", |
| 77 | + "text": "GitHub Action build result: *${{ job.status }}* :${{ job.status }}:" |
| 78 | + } |
| 79 | + }, |
| 80 | + { |
| 81 | + "type": "divider" |
| 82 | + }, |
| 83 | + { |
| 84 | + "type": "section", |
| 85 | + "text": { |
| 86 | + "type": "mrkdwn", |
| 87 | + "text": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
| 88 | + } |
| 89 | + } |
| 90 | + ] |
| 91 | + } |
| 92 | + env: |
| 93 | + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 94 | + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
0 commit comments