Skip to content

Commit

Permalink
bop
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertRosca committed Jan 25, 2024
1 parent 57aea8b commit da5c174
Showing 1 changed file with 26 additions and 39 deletions.
65 changes: 26 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
name: Build Packages

on: [push, pull_request]
on: pull-request

jobs:
find-recipes:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.find-recipes.outputs.packages }}
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -16,49 +17,35 @@ jobs:
id: changed
uses: jitterbit/get-changed-files@v1
with:
format: 'json'
format: "json"

- name: Find recipe.yaml files
id: find-recipes
run: |
changed=$(jq -c '[.[] | match("custom-recipes/recipes/([^/]*)/recipe.yaml") | .captures | .[].string]' <<< '${{steps.changed.outputs.added_modified}}')
changed=$(echo $changed | sed "s/\"//g")
echo "packages=\"$changed\""
echo "packages=\"$changed\"" >> "$GITHUB_OUTPUT"
buildc:
needs: find-recipes
runs-on: ubuntu-latest

steps:
- name: Foo
id: set-matrix
run: |
echo "${{needs.find-recipes.outputs.packages}}"
echo "package: ${{fromJson(needs.find-recipes.outputs.packages)}}"
changed='${{steps.changed.outputs.added_modified}}'
changed=$(echo $changed | jq -c '{include: [.[] | match("custom-recipes/recipes/([^/]*)/recipe.yaml") | .captures | .[].string | {package: .}]}')
echo "matrix=$changed"
echo "matrix=$changed" >> $GITHUB_OUTPUT
builda:
build:
needs: find-recipes
runs-on: ubuntu-latest
container:
image: ghcr.io/european-xfel/environments:main
options: --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=1g
strategy:
matrix:
package: ${{fromJson(needs.find-recipes.outputs.packages)}}

steps:
- name: Foo
run: |
echo "${{needs.find-recipes.outputs.packages}}"
echo "${{ matrix.packages }}"
matrix: ${{ fromJson(needs.find-recipes.outputs.matrix) }}
name: Build "${{ matrix.package }}"

buildb:
needs: find-recipes
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{needs.find-recipes.outputs.packages}}

steps:
- name: Foo
- name: Checkout Repository
uses: actions/checkout@v2

- name: Build
run: |
echo "${{needs.find-recipes.outputs.packages}}"
echo "${{ matrix.packages }}"
cd custom-recipes
mkdir conda-bld
source /opt/conda/etc/profile.d/conda.sh
conda activate base
./build.sh ${{ matrix.package }}
shell: bash

0 comments on commit da5c174

Please sign in to comment.