Add workflow for testing build of modules #1
Workflow file for this run
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
name: CI | |
# Controls when the action will run. | |
on: | |
pull_request: | |
branches: | |
- main | |
- '*-devel' | |
pull_request_review: | |
branches: | |
- main | |
- '*-devel' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build_and_test: | |
if: github.event_name != 'pull_request_review' || | |
contains(github.event.pull_request.labels.*.name, 'auto-pr') | |
# The type of runner that the job will run on | |
runs-on: ubuntu-20.04 | |
env: | |
GH_BASE: ${{ github.event.pull_request.base.ref }} | |
GH_HEAD: ${{ github.event.pull_request.head.ref }} | |
GH_SHA: ${{ github.event.pull_request.head.sha }} | |
steps: | |
- name: Install dependencies | |
run: sudo apt update && | |
sudo apt install -y | |
python3-dev | |
python3-numpy | |
libpython3-dev | |
- name: Checkout utilities | |
uses: actions/checkout@v4 | |
with: | |
path: utilities | |
fetch-depth: 0 | |
- name: Checkout C | |
uses: actions/checkout@v4 | |
with: | |
repository: Warwick-Plasma/SDF_C | |
ref: main | |
path: C | |
fetch-depth: 0 | |
- name: Merge branch | |
run: cd utilities && git config user.email "test@example.com" && | |
git config user.name "test" && | |
git checkout -b $GH_HEAD $GH_SHA && | |
git checkout -b $GH_BASE origin/$GH_BASE && | |
git merge --no-ff $GH_HEAD | |
- name: Compile | |
run: cd C && make && cd ../utilities && ./build.sh |