---
name: CI

# yamllint disable-line rule:truthy
on:
  pull_request:
    branches:
      - "*"
  push:
    branches:
      - "main"

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    name: build
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v5

      - name: setup
        run: |
          make version ci-setup
        env:
          PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
          GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

      - name: build
        run: make build-docker-image build-in-docker

      - name: test
        run: make validate-in-docker

      - name: upload packages
        uses: actions/upload-artifact@v4
        with:
          name: build
          path: build
