mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 08:32:16 +01:00
96 lines
2.7 KiB
YAML
96 lines
2.7 KiB
YAML
name: Continuous Integration
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.21'
|
|
cache: false
|
|
- name: Checkout source code
|
|
uses: actions/checkout@v4
|
|
- name: Run linters
|
|
uses: golangci/golangci-lint-action@v3
|
|
with:
|
|
version: v1.54.2
|
|
|
|
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
|
|
bash <(curl -s https://codecov.io/bash)
|
|
|
|
multiarch_build:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
needs:
|
|
- Tests
|
|
name: Multi-arch build
|
|
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_REPOSITORY=thecodingmachine
|
|
|
|
# FIXME: temporary job for checking if armhf build is working thanks to an upstream fix.
|
|
armhf_build:
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
continue-on-error: true
|
|
needs:
|
|
- Tests
|
|
name: armhf build
|
|
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 try of armhf Docker image variant
|
|
run: |
|
|
make release GOTENBERG_VERSION=armhf
|