Skip to content

Commit 808d9e5

Browse files
Update build-cli.yaml (#141)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Removed Docker Hub login steps from build workflows. * Upgraded Go module to version 1.24 and updated dependencies. * Increased PHP version requirement to 8.4 and upgraded PHP packages. * Updated Golang and PHP base images in Dockerfile. * Enhanced IDE configurations and cleaned redundant entries. * Refined time unit references and improved multibyte string trimming. * Removed CPU profiling and request logger options. * Reformatted code for multiline style and trailing commas. * Updated entity classes to extend base record with protected setters. * Introduced factory functions for entity and orchestration instance creation. * Replaced direct class instantiations with factory function calls across code and tests. * Improved code readability with formatting and style adjustments. * Replaced internal state ID and kind references to use a unified package. * Added authorization context injection in API request headers. * Simplified and corrected authorization and resource management code. * Added Docker build tag "nowatcher" for CLI build. * **New Features** * Added support for proxy code generation of public properties with getter/setter hooks. * Enhanced proxy generation to support hook behaviors modifying method implementations. * Added property get/set support via special syntax in entity history execution. * Introduced custom serialization and deserialization for record objects. * Added new API endpoints and client methods to share ownership and grant access to resources by user or role. * Extended CLI user creation command with roles and claims options. * Added authorization context classes and methods for sharing ownership and permission grants. * Added functions to instantiate authorization share types (Owner, Role, User) with allowed operations. * Extended durable client and remote clients with ownership sharing and permission management methods. * Added interface methods for entity and orchestration access control and ownership sharing. * **Bug Fixes** * Fixed typo in log message: "Unkown endpoint" → "Unknown endpoint". * **Tests** * Extended test interfaces with new public properties and updated proxy tests to use snapshots. * Added comprehensive unit tests for event description covering diverse scenarios and serialization. * Added serialization/deserialization tests for entity and orchestration record classes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Rob Landers <landers.robert@gmail.com> Signed-off-by: Robert Landers <landers.robert@gmail.com>
1 parent 2c33885 commit 808d9e5

File tree

78 files changed

+2261
-1033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2261
-1033
lines changed

.github/workflows/Test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
env:
1818
runner: self-hosted
1919
with:
20-
php-version: '8.3'
20+
php-version: '8.4'
2121
extensions: pcntl, xdebug
2222
tools: composer
2323
- name: Get composer cache directory

.github/workflows/build-cli.yaml

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,12 @@ on:
1313
branches:
1414
- v2
1515
jobs:
16-
build-linux:
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
platform: [ 'amd64', 'arm64' ]
21-
runs-on: self-hosted
22-
steps:
23-
- uses: actions/checkout@v4
24-
- name: Login to Docker Hub
25-
uses: docker/login-action@v3
26-
with:
27-
username: ${{ secrets.HUB_USERNAME }}
28-
password: ${{ secrets.HUB_PASSWORD }}
29-
- name: Configure QEMU
30-
uses: docker/setup-qemu-action@v3
31-
- name: Configure docker
32-
uses: docker/setup-buildx-action@v3
33-
with:
34-
platforms: ${{ matrix.platform }}
35-
- name: Expose GitHub Runtime
36-
uses: crazy-max/ghaction-github-runtime@v3
37-
- name: Build sources
38-
run: |
39-
echo "${{ secrets.GITHUB_TOKEN }}" > TOKEN
40-
docker buildx build --secret id=github-token,src=./TOKEN --cache-to type=gha,mode=max,scope=${{ matrix.platform }} --cache-from type=gha,scope=${{ matrix.platform }} --pull --load --platform linux/${{ matrix.platform }} --target cli-base-alpine -t builder .
41-
- name: Copy build
42-
run: |
43-
docker create --name builder builder
44-
docker cp builder:/go/src/app/cli/dist/dphp bin/dphp
45-
- name: Archive artifacts
46-
uses: actions/upload-artifact@v4
47-
with:
48-
name: dphp-${{ runner.os }}-${{ matrix.platform }}
49-
path: bin/dphp
5016
build-docker:
5117
runs-on: self-hosted
5218
outputs:
5319
image: ${{ steps.meta.outputs.tags }}
5420
steps:
5521
- uses: actions/checkout@v4
56-
- name: Login to Docker Hub
57-
uses: docker/login-action@v3
58-
with:
59-
username: ${{ secrets.HUB_USERNAME }}
60-
password: ${{ secrets.HUB_PASSWORD }}
6122
- name: Login to GitHub Container Registry
6223
uses: docker/login-action@v3
6324
with:
@@ -104,7 +65,7 @@ jobs:
10465
builder: ${{ steps.buildx.outputs.name }}
10566
cache-from: type=gha,scope=image
10667
cache-to: type=gha,mode=max,scope=image
107-
platforms: linux/amd64,linux/arm64
68+
platforms: linux/amd64
10869
- name: Build Test Image
10970
uses: docker/build-push-action@v6
11071
with:
@@ -118,53 +79,6 @@ jobs:
11879
builder: ${{ steps.buildx.outputs.name }}
11980
cache-from: type=gha,scope=image
12081
platforms: linux/amd64
121-
build-osx:
122-
strategy:
123-
fail-fast: false
124-
matrix:
125-
platform: [ 'arm64', 'x86_64' ]
126-
runs-on: ${{ matrix.platform == 'arm64' && 'macos-14' || 'macos-13' }}
127-
env:
128-
HOMEBREW_NO_AUTO_UPDATE: 1
129-
steps:
130-
- uses: actions/checkout@v4
131-
- uses: actions/setup-go@v5
132-
with:
133-
cache-dependency-path: cli/go.sum
134-
go-version-file: cli/go.mod
135-
- name: Configure Version
136-
run: |
137-
if [ "${GITHUB_REF_TYPE}" == "tag" ]; then
138-
export VERSION=${GITHUB_REF_NAME:1}
139-
else
140-
export VERSION=${GITHUB_SHA}
141-
fi
142-
143-
echo "VERSION=${VERSION}" >> "${GITHUB_ENV}"
144-
- name: Configure cache
145-
uses: actions/cache@v4
146-
with:
147-
path: dist
148-
key: ${{ matrix.platform }}-${{ hashFiles('cli/*.mod') }}
149-
- name: Run doctor
150-
run: |
151-
export GITHUB_TOKEN "${{ secrets.GITHUB_TOKEN }}"
152-
BUILD=no cli/build-php.sh
153-
- name: Build php
154-
run: |
155-
export GITHUB_TOKEN "${{ secrets.GITHUB_TOKEN }}"
156-
cli/build-php.sh
157-
- name: Build cli
158-
run: |
159-
export GITHUB_TOKEN "${{ secrets.GITHUB_TOKEN }}"
160-
cd cli && ./build.sh
161-
- run: ls -lah cli/dist/
162-
- run: ls -lah dist/ || true
163-
- name: Archive artifacts
164-
uses: actions/upload-artifact@v4
165-
with:
166-
name: dphp-${{ runner.os }}-${{ matrix.platform }}
167-
path: cli/dist/dphp
16882
performance-test:
16983
name: Performance Test
17084
needs:

.idea/codeception.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.idea/durable-php.iml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/phpspec.xml

Lines changed: 0 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM golang:1.24.0-alpine AS golang-base
2-
FROM php:8.4.3-zts AS php-base
1+
FROM golang:1.24.5-alpine AS golang-base
2+
FROM php:8.4.10-zts AS php-base
33
FROM golang-base AS cli-base-alpine
44

55
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
@@ -29,21 +29,21 @@ RUN apk update; \
2929
m4 \
3030
make \
3131
pkgconfig \
32-
php83 \
33-
php83-common \
34-
php83-ctype \
35-
php83-curl \
36-
php83-dom \
37-
php83-mbstring \
38-
php83-openssl \
39-
php83-pcntl \
40-
php83-phar \
41-
php83-posix \
42-
php83-session \
43-
php83-sodium \
44-
php83-tokenizer \
45-
php83-xml \
46-
php83-xmlwriter \
32+
php84 \
33+
php84-common \
34+
php84-ctype \
35+
php84-curl \
36+
php84-dom \
37+
php84-mbstring \
38+
php84-openssl \
39+
php84-pcntl \
40+
php84-phar \
41+
php84-posix \
42+
php84-session \
43+
php84-sodium \
44+
php84-tokenizer \
45+
php84-xml \
46+
php84-xmlwriter \
4747
upx \
4848
wget \
4949
xz ; \
@@ -54,6 +54,7 @@ ENV PHP_EXTENSIONS="apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,exif,fileinfo,fi
5454
ENV PHP_EXTENSION_LIBS="bzip2,freetype,libavif,libjpeg,libwebp,libzip"
5555

5656
WORKDIR /go/src/app
57+
COPY .git /go/src/app/.git
5758
COPY cli/build-php.sh .
5859
RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) BUILD=no ./build-php.sh
5960
RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) ./build-php.sh
@@ -107,7 +108,7 @@ ENV GOBIN=/usr/local/bin
107108
RUN go get durable_php
108109
#RUN go test ./...
109110

110-
RUN go install -ldflags "-w -s -X 'main.version=$VERSION'"
111+
RUN CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go install --tags nowatcher -ldflags "-w -s -X 'main.version=$VERSION'"
111112

112113
FROM common AS durable-php
113114
COPY --from=builder /usr/local/bin/durable_php /usr/local/bin/dphp

0 commit comments

Comments
 (0)