forked from systemfsoftware/systemfsoftware
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.37 KB
/
Copy pathmutation.yml
File metadata and controls
78 lines (68 loc) · 2.37 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Mutation
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: mutation-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
checks: write
jobs:
discover:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
packages: ${{ steps.discover.outputs.packages }}
package_count: ${{ steps.discover.outputs.package_count }}
steps:
- uses: actions/checkout@v7
- id: discover
run: |
PACKAGES=$(find . -name "stryker.config.json" -not -path "./node_modules/*" -exec dirname {} \; | sed 's|^\./||' | jq -R -s -c 'split("\n") | map(select(length > 0))')
if [ -z "$PACKAGES" ] || [ "$PACKAGES" = "[]" ]; then
PACKAGES="[]"
fi
echo "packages=$PACKAGES" >> "$GITHUB_OUTPUT"
echo "package_count=$(echo "$PACKAGES" | jq 'length')" >> "$GITHUB_OUTPUT"
mutation:
needs: discover
if: needs.discover.outputs.package_count > 0
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.discover.outputs.packages) }}
name: Mutation (${{ matrix.package }})
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/install-deps
- run: corepack pnpm build
- uses: actions/cache/restore@v6
with:
path: ${{ matrix.package }}/reports/stryker-incremental.json
key: ${{ runner.os }}-stryker-${{ matrix.package }}-main
restore-keys: |
${{ runner.os }}-stryker-${{ matrix.package }}-
- run: corepack pnpm turbo mutation --filter=./${{ matrix.package }}
- uses: actions/cache/save@v6
if: github.ref == 'refs/heads/main'
with:
path: ${{ matrix.package }}/reports/stryker-incremental.json
key: ${{ runner.os }}-stryker-${{ matrix.package }}-main-${{ github.run_id }}
- name: Sanitize artifact name
id: sanitize
if: always()
run: echo "name=$(echo '${{ matrix.package }}' | tr '/' '-')" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v7
if: always()
continue-on-error: true
with:
name: mutation-report-${{ steps.sanitize.outputs.name }}-${{ github.run_number }}
path: ${{ matrix.package }}/reports/*
retention-days: 1