Skip to content

Commit

Permalink
allow multiple branches in plugin test CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Jul 26, 2024
1 parent 699b141 commit dc70f9d
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/plugin_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ jobs:
include:

- plugin: pynxtools-ellips
branch: main
branches: main
tests_to_run: tests/.
- plugin: pynxtools-raman
branch: main
branches: main
tests_to_run: tests/.
- plugin: pynxtools-mpes
branch: main
branches: update-to-new-nxmpes, main
tests_to_run: tests/.
- plugin: pynxtools-stm
branch: main
branches: main
tests_to_run: tests/.
- plugin: pynxtools-xps
branch: main
branches: use-multiformat-reader, main
tests_to_run: tests/.
# - plugin: pynxtools-apm
# branch: main
# branches: main
# tests_to_run: tests/.
# - plugin: pynxtools-xrd
# branch: update-tests
# branches: main
# tests_to_run: tests/.
# - plugin: pynxtools-em
# branch: main
# branches: main
# tests_to_run: tests/.
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
Expand All @@ -61,13 +61,34 @@ jobs:
- name: Install package
run: |
uv pip install ".[dev]"
- name: Check if branch exists
id: check-branch
run: |
branch_exists=false
branches=(${{ matrix.branches }})
for branch in ${branches[@]}; do
echo "Checking branch: $branch"
if git ls-remote --heads https://github.com/FAIRmat-NFDI/${{ matrix.plugin }}.git $branch | grep -q "refs/heads/$branch"; then
echo "Branch $branch exists."
echo "branch=$branch" >> $GITHUB_ENV
branch_exists=true
break
fi
done
if [ "$branch_exists" = "false" ]; then
echo "No branches exist."
exit 1
fi
- name: Output environment variables for debugging
run: |
echo "Selected branch: ${{ env.branch }}"
- name: Clone ${{ matrix.plugin }} repo
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: FAIRmat-NFDI/${{ matrix.plugin }}
path: ${{ matrix.plugin }}
ref: ${{ matrix.branch }}
ref: ${{ env.branch }}
- name: Install nomad
run: |
uv pip install nomad-lab@git+https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR.git
Expand Down

0 comments on commit dc70f9d

Please sign in to comment.