-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (49 loc) · 1.51 KB
/
test_examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Test examples
on:
pull_request:
branches:
- main
- release/**
push:
paths:
- .github/workflows/test_examples.yml
- examples/**
- modules/**
- devenv.nix
- devenv.yaml
env:
DEVENV_VERSION: v0.6.3
jobs:
list-examples:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: echo "matrix=$(ls ${GITHUB_WORKSPACE}/examples/ | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
test_examples:
needs: list-examples
runs-on: ubuntu-latest
strategy:
matrix:
manifest: ${{ fromJson(needs.list-examples.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- uses: cachix/cachix-action@v12
with:
name: devenv
- name: Install direnv
run: sudo apt update && sudo apt install direnv
- name: Install devenv.sh
run: nix profile install --accept-flake-config tarball+https://install.devenv.sh/${DEVENV_VERSION}
shell: sh
- name: Test ${{ matrix.manifest }} example
run: |
cd ${GITHUB_WORKSPACE}/examples/${{ matrix.manifest }}
sed -i "s,url: github:kellerkinderDE/devenv-shopware?ref=v1.0.3,url: path:${GITHUB_WORKSPACE}," devenv.yaml
echo running on ${GITHUB_REPOSITORY} with ref ${GITHUB_REF_NAME}
direnv allow && direnv reload
devenv ci -vvv
devenv shell echo ok