-
Notifications
You must be signed in to change notification settings - Fork 1
168 lines (155 loc) · 6.05 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
name: ci
on:
push:
branches:
- master
- dev-1.x
- develop
pull_request:
branches:
- master
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
PHP_VERSION:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
COVERAGE: ["true", "false"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: I am tired of writing this shit in YAML and learning a new DSL for every CI service so I'm putting everything in a FSCKING BASH SCRIPT
env:
PHP_VERSION: ${{ matrix.PHP_VERSION }}
COVERAGE: ${{ matrix.COVERAGE }}
run: bash ./.github/scripts/linux.sh
- name: Coveralls
if: ${{ matrix.COVERAGE == 'true' }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.info
osx:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
PHP_VERSION:
# broken and don't care apple is trash
# - "8.1"
# - "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: I am tired of writing this shit in YAML and learning a new DSL for every CI service so I'm putting everything in a FSCKING BASH SCRIPT
env:
PHP_VERSION: ${{ matrix.PHP_VERSION }}
run: bash ./.github/scripts/osx.sh
docker-debian:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
PHP_VERSION:
- "8.1"
- "8.2"
- "8.3"
- "8.4.0RC1"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: I am tired of writing this shit in YAML and learning a new DSL for every CI service so I am putting everything in a FSCKING BASH SCRIPT
env:
PHP_VERSION: ${{ matrix.PHP_VERSION }}
DOCKER_NAME: debian
run: bash ./.github/scripts/docker.sh
docker-alpine:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
PHP_VERSION:
- "8.1"
- "8.2"
- "8.3"
- "8.4.0RC1"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: I am tired of writing this shit in YAML and learning a new DSL for every CI service so I am putting everything in a FSCKING BASH SCRIPT
env:
PHP_VERSION: ${{ matrix.PHP_VERSION }}
DOCKER_NAME: alpine
run: bash ./.github/scripts/docker.sh
docker-fedora:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: I am tired of writing this shit in YAML and learning a new DSL for every CI service so I am putting everything in a FSCKING BASH SCRIPT
env:
DOCKER_NAME: fedora
TEST_PHP_EXECUTABLE: /usr/bin/php
run: bash ./.github/scripts/docker.sh
nix-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- 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@v27
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 }}"
- 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