mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
ci updates
This commit is contained in:
parent
7419a32685
commit
5335478c97
4 changed files with 27 additions and 47 deletions
16
.forgejo/workflows/ci.yaml
Normal file
16
.forgejo/workflows/ci.yaml
Normal 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
|
||||
|
|
@ -4,7 +4,7 @@ on:
|
|||
push:
|
||||
branches: ["main"]
|
||||
paths:
|
||||
- ".github/**"
|
||||
- ".forgejo/**"
|
||||
- "images/**"
|
||||
|
||||
permissions:
|
||||
|
|
@ -25,30 +25,30 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
- uses: https://github.com/dorny/paths-filter@v3
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
php:
|
||||
- '.github/**'
|
||||
- '.forgejo/**'
|
||||
- 'images/php/**'
|
||||
haze:
|
||||
- '.github/**'
|
||||
- '.forgejo/**'
|
||||
- 'images/php/**'
|
||||
- 'images/haze/**'
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build php image
|
||||
if: steps.changes.outputs.php == 'true'
|
||||
uses: docker/build-push-action@v5
|
||||
uses: https://github.com/docker/build-push-action@v5
|
||||
with:
|
||||
context: "images/php"
|
||||
push: true
|
||||
|
|
@ -56,17 +56,13 @@ jobs:
|
|||
build-args: |
|
||||
PHP_VERSION=${{ matrix.php-version }}
|
||||
BASE_IMAGE=${{ matrix.variant == '-dbg' && 'icewind1991/php-dbg' || 'php' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build haze image
|
||||
if: steps.changes.outputs.haze == 'true'
|
||||
uses: docker/build-push-action@v5
|
||||
uses: https://github.com/docker/build-push-action@v5
|
||||
with:
|
||||
context: "images/haze"
|
||||
push: true
|
||||
tags: icewind1991/haze:${{ matrix.php-version }}${{ matrix.variant }}
|
||||
build-args: |
|
||||
PHP_VERSION=${{ matrix.php-version }}${{ matrix.variant }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
|
@ -27,15 +27,15 @@ jobs:
|
|||
matrix: ${{fromJson(needs.matrix.outputs.cross-matrix)}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v27
|
||||
- uses: icewind1991/attic-action@v1
|
||||
- uses: https://github.com/cachix/install-nix-action@v27
|
||||
- uses: https://codeberg.org/icewind/attic-action@v1
|
||||
with:
|
||||
name: ci
|
||||
instance: https://cache.icewind.me
|
||||
authToken: "${{ secrets.ATTIC_TOKEN }}"
|
||||
- run: nix build .#${{ matrix.target }}
|
||||
- name: Upload binary to release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
uses: https://github.com/svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: result/bin/haze${{ matrix.binary-suffix }}
|
||||
32
.github/workflows/ci.yaml
vendored
32
.github/workflows/ci.yaml
vendored
|
|
@ -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 }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue