mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
100 lines
2.9 KiB
YAML
100 lines
2.9 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
|
|
|
|
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.63.4
|
|
|
|
tests:
|
|
needs:
|
|
- lint
|
|
name: Tests
|
|
# TODO: once arm64 actions are available, also run the tests on this architecture.
|
|
# See: https://github.com/actions/virtual-environments/issues/2552#issuecomment-771478000.
|
|
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@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
verbose: true
|
|
|
|
snapshot_release:
|
|
if: github.event_name == 'pull_request'
|
|
needs:
|
|
- tests
|
|
name: Snapshot release
|
|
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: Log in to Docker Hub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build and push snapshot Docker image (linux/amd64)
|
|
run: make release GOTENBERG_VERSION=${{ github.head_ref }} DOCKER_REPOSITORY=snapshot LINUX_AMD64_RELEASE=true
|
|
|
|
edge_release:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs:
|
|
- tests
|
|
name: Edge release
|
|
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: Log in to Docker Hub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build and push Docker image for main branch
|
|
run: |
|
|
make release GOTENBERG_VERSION=edge
|
|
make release GOTENBERG_VERSION=edge DOCKER_REGISTRY=thecodingmachine
|