1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

ci updates

This commit is contained in:
Robin Appelman 2025-05-23 17:38:32 +02:00
commit 5335478c97
4 changed files with 27 additions and 47 deletions

View file

@ -0,0 +1,16 @@
name: "CI"
on:
pull_request:
push:
jobs:
checks:
runs-on: nix
steps:
- uses: actions/checkout@v4
- uses: https://codeberg.org/icewind/attic-action@v1
with:
name: link
instance: https://cache.icewind.link
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix flake check --keep-going

View file

@ -4,7 +4,7 @@ on:
push: push:
branches: ["main"] branches: ["main"]
paths: paths:
- ".github/**" - ".forgejo/**"
- "images/**" - "images/**"
permissions: permissions:
@ -25,30 +25,30 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- uses: dorny/paths-filter@v3 - uses: https://github.com/dorny/paths-filter@v3
id: changes id: changes
with: with:
filters: | filters: |
php: php:
- '.github/**' - '.forgejo/**'
- 'images/php/**' - 'images/php/**'
haze: haze:
- '.github/**' - '.forgejo/**'
- 'images/php/**' - 'images/php/**'
- 'images/haze/**' - 'images/haze/**'
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@v3 uses: https://github.com/docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: https://github.com/docker/setup-buildx-action@v3
- name: Build php image - name: Build php image
if: steps.changes.outputs.php == 'true' if: steps.changes.outputs.php == 'true'
uses: docker/build-push-action@v5 uses: https://github.com/docker/build-push-action@v5
with: with:
context: "images/php" context: "images/php"
push: true push: true
@ -56,17 +56,13 @@ jobs:
build-args: | build-args: |
PHP_VERSION=${{ matrix.php-version }} PHP_VERSION=${{ matrix.php-version }}
BASE_IMAGE=${{ matrix.variant == '-dbg' && 'icewind1991/php-dbg' || 'php' }} BASE_IMAGE=${{ matrix.variant == '-dbg' && 'icewind1991/php-dbg' || 'php' }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build haze image - name: Build haze image
if: steps.changes.outputs.haze == 'true' if: steps.changes.outputs.haze == 'true'
uses: docker/build-push-action@v5 uses: https://github.com/docker/build-push-action@v5
with: with:
context: "images/haze" context: "images/haze"
push: true push: true
tags: icewind1991/haze:${{ matrix.php-version }}${{ matrix.variant }} tags: icewind1991/haze:${{ matrix.php-version }}${{ matrix.variant }}
build-args: | build-args: |
PHP_VERSION=${{ matrix.php-version }}${{ matrix.variant }} PHP_VERSION=${{ matrix.php-version }}${{ matrix.variant }}
cache-from: type=gha
cache-to: type=gha,mode=max

View file

@ -27,15 +27,15 @@ jobs:
matrix: ${{fromJson(needs.matrix.outputs.cross-matrix)}} matrix: ${{fromJson(needs.matrix.outputs.cross-matrix)}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27 - uses: https://github.com/cachix/install-nix-action@v27
- uses: icewind1991/attic-action@v1 - uses: https://codeberg.org/icewind/attic-action@v1
with: with:
name: ci name: ci
instance: https://cache.icewind.me instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}" authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#${{ matrix.target }} - run: nix build .#${{ matrix.target }}
- name: Upload binary to release - name: Upload binary to release
uses: svenstaro/upload-release-action@v2 uses: https://github.com/svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
file: result/bin/haze${{ matrix.binary-suffix }} file: result/bin/haze${{ matrix.binary-suffix }}

View file

@ -1,32 +0,0 @@
name: "CI"
on:
pull_request:
push:
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
- id: set-matrix
run: echo "matrix={\"check\":$(nix eval --json '.#checks.x86_64-linux' --apply 'builtins.attrNames')}" | tee -a $GITHUB_OUTPUT
checks:
runs-on: ubuntu-latest
needs: [matrix]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
name: ${{ matrix.check }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- uses: icewind1991/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#checks.x86_64-linux.${{ matrix.check }}