---
name: build-and-test

on:
  workflow_call:

permissions:
  contents: read

jobs:
  with-go:
    strategy:
      matrix:
        go-version: [1.24.2]
        platform: [ubuntu-latest]
    runs-on: ${{ matrix.platform }}
    steps:
      - name: Check out code
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

      - name: Set up Go ${{ matrix.go-version }}
        uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
        with:
          go-version: ${{ matrix.go-version }}

      - name: Build
        run: make

      - name: Test
        run: |
          go test -v -run TestGithubPushPull ./bridge/github
        env:
          GITHUB_USER: ${{ vars.TEST_USER_GITHUB }}
          GITHUB_TOKEN: ${{ secrets.TEST_TOKEN_GITHUB }}
          GITHUB_TOKEN_PRIVATE: ${{ secrets._GITHUB_TOKEN_PRIVATE }}
          GITHUB_TOKEN_PUBLIC: ${{ secrets._GITHUB_TOKEN_PUBLIC }}
