Skip to content

Commit 0eac230

Browse files
committed
ci: add build workflow
1 parent e9e5e37 commit 0eac230

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Build Packages
3+
4+
on: pull_request
5+
6+
jobs:
7+
find-recipes:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
matrix: ${{ steps.set-matrix.outputs.matrix }}
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v2
15+
16+
- name: Get Changed Files
17+
id: changed
18+
uses: jitterbit/get-changed-files@v1
19+
with:
20+
format: "json"
21+
22+
- name: Find recipe.yaml files
23+
id: set-matrix
24+
run: |
25+
changed='${{steps.changed.outputs.added_modified}}'
26+
changed=$(echo $changed | jq -c '{include: [.[] | match("custom-recipes/recipes/([^/]*)/recipe.yaml") | .captures | .[].string | {package: .}]}')
27+
echo "matrix=$changed"
28+
echo "matrix=$changed" >> $GITHUB_OUTPUT
29+
30+
build:
31+
needs: find-recipes
32+
runs-on: ubuntu-latest
33+
container:
34+
image: ghcr.io/european-xfel/environments:main
35+
options: --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=1g
36+
strategy:
37+
matrix: ${{ fromJson(needs.find-recipes.outputs.matrix) }}
38+
name: Build "${{ matrix.package }}"
39+
40+
steps:
41+
- name: Checkout Repository
42+
uses: actions/checkout@v2
43+
44+
- name: Build
45+
run: |
46+
cd custom-recipes
47+
mkdir conda-bld
48+
source /opt/conda/etc/profile.d/conda.sh
49+
conda activate base
50+
./build.sh ${{ matrix.package }}
51+
shell: bash

0 commit comments

Comments
 (0)