-
Notifications
You must be signed in to change notification settings - Fork 32
177 lines (162 loc) · 6.33 KB
/
ci.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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: ci
on:
push:
branches:
- master
- develop
- github-actions
- ci
pull_request:
branches:
- master
jobs:
linux:
if: "!contains(github.event.head_commit.message, 'ci skip')"
name: PHP ${{ matrix.php-versions }} / ${{ matrix.operating-system }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
coverage:
- "true"
- "false"
steps:
- uses: actions/checkout@v3
- run: bash .github/scripts/linux.sh
env:
PHP_VERSION: ${{ matrix.php-versions }}
COVERAGE: ${{ matrix.coverage }}
- name: Coveralls
if: ${{ matrix.coverage == 'true' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.info
osx:
if: "!contains(github.event.head_commit.message, 'ci skip')"
name: PHP ${{ matrix.php-versions }} / ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system:
- "macos-latest"
php-versions:
# these are broken but Apple is trash, so I don't care
- "8.3"
steps:
- uses: actions/checkout@v3
- run: bash .github/scripts/osx.sh
env:
PHP_VERSION: ${{ matrix.php-versions }}
docker:
if: "!contains(github.event.head_commit.message, 'ci skip')"
name: PHP ${{ matrix.php-versions }} / ${{ matrix.docker-image }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
docker-image:
- "alpine"
- "debian"
php-versions:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4.0RC1"
steps:
- uses: actions/checkout@v3
- run: bash .github/scripts/docker.sh
env:
PHP_VERSION: ${{ matrix.php-versions }}
DOCKER_NAME: ${{ matrix.docker-image }}
docker-fedora:
if: "!contains(github.event.head_commit.message, 'ci skip')"
name: fedora
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: bash .github/scripts/docker.sh
env:
DOCKER_NAME: fedora
TEST_PHP_EXECUTABLE: /usr/bin/php
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v29
with:
nix_path: nixpkgs=channel:nixos-24.05
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
- id: set-matrix
name: Generate Nix Matrix
run: |
set -Eeu
matrix="$(nix eval --json '.#githubActions.matrix')"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
nix:
name: "nix (${{ matrix.name }})"
runs-on: ${{ matrix.os }}
needs: nix-matrix
strategy:
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Set Up Build Cache
uses: actions/cache@v4
id: nix-cache
with:
path: /tmp/nix-store.nar
key: nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }}
restore-keys: |
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-${{ matrix.attr }}
nix-store.nar-${{ runner.os }}-${{ hashFiles('flake.lock') }}-
nix-store.nar-${{ runner.os }}-
- uses: cachix/install-nix-action@v29
with:
nix_path: nixpkgs=channel:nixos-24.05
extra_nix_config: "system-features = nixos-test benchmark big-parallel kvm"
- name: Import Nix Store Cache
if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: |
nix-store --import < /tmp/nix-store.nar
- run: nix build -L ".#${{ matrix.attr }}"
- run: find -L result*; cp result-coverage/coverage.info coverage.info || true
# - name: Upload coverage reports to Codecov
# if: ${{ hashFiles('coverage.info') != '' }}
# uses: codecov/codecov-action@v4
# with:
# file: coverage.info
# token: ${{ secrets.CODECOV_TOKEN }}
# slug: jbboehr/php-perfifidous
# - name: Coveralls
# if: ${{ hashFiles('coverage.info') != '' }}
# uses: coverallsapp/github-action@v2
# continue-on-error: true
# with:
# file: coverage.info
# format: lcov
# parallel: true
- name: Export Nix Store Cache
shell: bash
# partially based on https://github.com/NixOS/nix/issues/1245#issuecomment-282586759
run: |
drv="$(nix-store -qd "$(readlink result)")"
drvRefs="$( echo "$drv" | xargs nix-store -q --references )"
( echo "$drvRefs" | grep '[.]drv$' | xargs nix-store -q --outputs ;
echo "$drvRefs" | grep -v '[.]drv$' ) | \
xargs nix-store -r | \
xargs nix-store -qR |
xargs nix-store --export > /tmp/nix-store.nar