Skip to content

Commit

Permalink
Merge branch 'master' into ParameterizePHPVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
danog authored Jan 26, 2025
2 parents c67e7d9 + 0703966 commit c306c87
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/watch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_dispatch:
schedule:
- cron: '30 */4 * * *'
push:
branches:
- master

jobs:
docker:
Expand All @@ -22,8 +25,7 @@ jobs:
- name: Update Dockerfile with latest version
id: fetch_version
run: |
last=$(curl -s https://packagist.org/packages/vimeo/psalm.json|jq '[.package.versions[]|select(.version|test("^\\d+\\.\\d+\\.\\d+$"))|.version]|max_by(.|[splits("[.]")]|map(tonumber))')
last=$(echo $last | tr -d '"')
last=$(curl -s 'https://packagist.org/packages/vimeo/psalm.json?v=latest'|jq '[.package.versions[]|select(.version|test("^\\d+\\.\\d+\\.\\d+$"))|.version]|max_by(.|[splits("[.]")]|map(tonumber))' | tr -d '"')
echo "Last Psalm version is $last"
echo "last=$last" >> $GITHUB_OUTPUT
Expand All @@ -38,11 +40,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build images
run: docker build -t ghcr.io/psalm/psalm-github-actions:${{ steps.fetch_version.outputs.last }} -t ghcr.io/psalm/psalm-github-actions:latest .
run: |
last=$(curl -s 'https://packagist.org/packages/vimeo/psalm.json?v=latest'|jq '[.package.versions[]|select(.version|test("^\\d+\\.\\d+\\.\\d+$"))|.version]|max_by(.|[splits("[.]")]|map(tonumber))' | tr -d '"')
docker build -t ghcr.io/psalm/psalm-github-actions:$last -t ghcr.io/psalm/psalm-github-actions:latest .
- name: Publish
run: |
docker push ghcr.io/psalm/psalm-github-actions:${{ steps.fetch_version.outputs.last }}
last=$(curl -s 'https://packagist.org/packages/vimeo/psalm.json?v=latest'|jq '[.package.versions[]|select(.version|test("^\\d+\\.\\d+\\.\\d+$"))|.version]|max_by(.|[splits("[.]")]|map(tonumber))' | tr -d '"')
docker push ghcr.io/psalm/psalm-github-actions:$last
docker push ghcr.io/psalm/psalm-github-actions:latest
workflow-keepalive:
Expand All @@ -51,6 +56,6 @@ jobs:
permissions:
actions: write
steps:
- uses: liskin/gh-workflow-keepalive@v1.1.0
- uses: liskin/gh-workflow-keepalive@v1.2.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-alpine
FROM php:8.4-cli-alpine

LABEL "com.github.actions.name"="Psalm"
LABEL "com.github.actions.description"="A static analysis tool for finding errors in PHP applications"
Expand Down Expand Up @@ -34,7 +34,7 @@ ENV PATH /composer/vendor/bin:${PATH}

RUN docker-php-ext-install opcache
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
RUN echo -e "zend.assertions=1\nopcache.enable_cli=true\nopcache.jit_buffer_size=512M\nopcache.jit=1205" >> "$PHP_INI_DIR/php.ini"
RUN echo -e "zend.assertions=1\nopcache.enable_cli=true" >> "$PHP_INI_DIR/php.ini"

# Satisfy Psalm's quest for a composer autoloader (with a symlink that disappears once a volume is mounted at /app)

Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ else
fi

/composer/vendor/bin/psalm --version
/composer/vendor/bin/psalm --output-format=github $TAINT_ANALYSIS $REPORT $SHOW_INFO $PHP_VERSION $*
/composer/vendor/bin/psalm --force-jit --output-format=github $TAINT_ANALYSIS $REPORT $SHOW_INFO $PHP_VERSION $*

0 comments on commit c306c87

Please sign in to comment.