mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-07-02 08:27:41 +08:00
296 lines
8.7 KiB
YAML
296 lines
8.7 KiB
YAML
name: Continuous Integration
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
concurrency:
|
|
group: ${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || 'main' }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.23"
|
|
cache: false
|
|
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Run linters
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
version: v1.64.2
|
|
|
|
tests:
|
|
needs:
|
|
- lint
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build testing environment
|
|
run: make build build-tests
|
|
|
|
- name: Run tests
|
|
run: make tests-once
|
|
|
|
- name: Upload to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
verbose: true
|
|
|
|
snapshot_amd64:
|
|
if: github.event_name == 'pull_request'
|
|
needs:
|
|
- tests
|
|
name: Snapshot linux/amd64
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: pr-${{ github.event.pull_request.number }}
|
|
platform: linux/amd64
|
|
alternate_repository: snapshot
|
|
|
|
snapshot_386:
|
|
if: github.event_name == 'pull_request'
|
|
needs:
|
|
- tests
|
|
name: Snapshot linux/386
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: pr-${{ github.event.pull_request.number }}
|
|
platform: linux/386
|
|
alternate_repository: snapshot
|
|
|
|
snapshot_arm64:
|
|
if: github.event_name == 'pull_request'
|
|
needs:
|
|
- tests
|
|
name: Snapshot linux/arm64
|
|
runs-on: ubuntu-24.04-arm
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: pr-${{ github.event.pull_request.number }}
|
|
platform: linux/arm64
|
|
alternate_repository: snapshot
|
|
|
|
snapshot_arm_v7:
|
|
if: github.event_name == 'pull_request'
|
|
needs:
|
|
- tests
|
|
name: Snapshot linux/arm/v7
|
|
runs-on: ubuntu-24.04-arm
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: pr-${{ github.event.pull_request.number }}
|
|
platform: linux/arm/v7
|
|
alternate_repository: snapshot
|
|
|
|
merge_clean_snapshot_tags:
|
|
needs:
|
|
- snapshot_amd64
|
|
- snapshot_386
|
|
- snapshot_arm64
|
|
- snapshot_arm_v7
|
|
name: Merge and clean snapshot tags
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Merge
|
|
uses: ./.github/actions/merge
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
tags: "${{ needs.snapshot_amd64.outputs.tags }},${{ needs.snapshot_386.outputs.tags }},${{ needs.snapshot_arm64.outputs.tags }},${{ needs.snapshot_arm_v7.outputs.tags }}"
|
|
|
|
- name: Clean
|
|
uses: ./.github/actions/clean
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
tags: "${{ needs.snapshot_amd64.outputs.tags }},${{ needs.snapshot_386.outputs.tags }},${{ needs.snapshot_arm64.outputs.tags }},${{ needs.snapshot_arm_v7.outputs.tags }}"
|
|
|
|
edge_amd64:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs:
|
|
- tests
|
|
name: Edge linux/amd64
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: edge
|
|
platform: linux/amd64
|
|
|
|
edge_386:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs:
|
|
- tests
|
|
name: Edge linux/386
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: edge
|
|
platform: linux/386
|
|
|
|
edge_arm64:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs:
|
|
- tests
|
|
name: Edge linux/arm64
|
|
runs-on: ubuntu-24.04-arm
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: edge
|
|
platform: linux/arm64
|
|
|
|
edge_arm_v7:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs:
|
|
- tests
|
|
name: Edge linux/arm/v7
|
|
runs-on: ubuntu-24.04-arm
|
|
outputs:
|
|
tags: ${{ steps.build_push.outputs.tags }}
|
|
tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }}
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push
|
|
id: build_push
|
|
uses: ./.github/actions/build-push
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
version: edge
|
|
platform: linux/arm/v7
|
|
|
|
merge_clean_edge_tags:
|
|
needs:
|
|
- edge_amd64
|
|
- edge_386
|
|
- edge_arm64
|
|
- edge_arm_v7
|
|
name: Merge and clean edge tags
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Merge
|
|
uses: ./.github/actions/merge
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
tags: "${{ needs.edge_amd64.outputs.tags }},${{ needs.edge_386.outputs.tags }},${{ needs.edge_arm64.outputs.tags }},${{ needs.edge_arm_v7.outputs.tags }}"
|
|
alternate_registry: thecodingmachine
|
|
|
|
- name: Clean
|
|
uses: ./.github/actions/clean
|
|
with:
|
|
docker_hub_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
docker_hub_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
tags: "${{ needs.edge_amd64.outputs.tags }},${{ needs.edge_386.outputs.tags }},${{ needs.edge_arm64.outputs.tags }},${{ needs.edge_arm_v7.outputs.tags }}"
|