Skip to content

chore(go): bump cloud.google.com/go/pubsub from 1.50.3 to 1.50.4 in /pubsubc #686

chore(go): bump cloud.google.com/go/pubsub from 1.50.3 to 1.50.4 in /pubsubc

chore(go): bump cloud.google.com/go/pubsub from 1.50.3 to 1.50.4 in /pubsubc #686

name: Verify pull request
"on":
pull_request:
branches:
- "master"
types:
- "opened"
- "reopened"
- "synchronize"
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
image_tag: "tungbeier/gcloud-pubsub-emulator:test"
jobs:
preparation:
name: Prepare for build
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ github.event.pull_request.draft == false }}
outputs:
has_changed: ${{ steps.changed-files.outputs.any_changed }}
steps:
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Get changed modules
id: changed-files
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
if: github.event_name == 'pull_request'
with:
files: |
Dockerfile
run.sh
container-structure-test.yaml
.github/workflows/python-pubsub/**
.github/workflows/publish.yaml
.github/workflows/verify-pullrequest.yaml
pubsubc/
scan_image:
name: Scan image
runs-on: ubuntu-latest
needs: preparation
timeout-minutes: 30
if: ${{ github.event.pull_request.draft == false && needs.preparation.outputs.has_changed == 'true' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Scan dir
id: scan_dir
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
with:
path: "."
fail-build: false
only-fixed: true
severity-cutoff: high
- uses: ./.github/actions/build-image
with:
image: ${{ env.image_tag }}
- name: Scan image
id: scan_image
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
with:
image: ${{ env.image_tag }}
fail-build: false
only-fixed: true
severity-cutoff: high
- name: Output scan results
run: |
{
echo "Grype scan results"
echo ""
echo '<details>'
echo '<summary>Directory scan result</summary>'
echo ""
echo '```json'
cat ${{ steps.scan_dir.outputs.sarif }} | jq '.'
echo '```'
echo ""
echo '</details>'
echo ""
echo '<details>'
echo '<summary>Image scan result</summary>'
echo ""
echo '```json'
cat ${{ steps.scan_image.outputs.sarif }} | jq '.'
echo '```'
echo ""
echo '</details>'
} >> "$GITHUB_STEP_SUMMARY"
test_image:
name: Test image
runs-on: ubuntu-latest
needs: preparation
timeout-minutes: 30
if: ${{ github.event.pull_request.draft == false && needs.preparation.outputs.has_changed == 'true' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ./.github/actions/build-image
with:
image: ${{ env.image_tag }}
- name: Set up python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: '3.14'
- name: Run tests
env:
project: 'test-project'
topic: 'test-topic'
subscription: 'test-subscription'
run: |
docker run --detach --rm \
--name emulator \
--publish 8681:8681 \
--env PUBSUB_PROJECT1=${{ env.project }},${{ env.topic }} \
${{ env.image_tag }}
export PUBSUB_EMULATOR_HOST=localhost:8681
cd .github/workflows/python-pubsub
echo "[INFO] Install python requirements"
pip install -q -r requirements.txt
echo "[INFO] Create pull subscription"
python subscriber.py ${{ env.project }} create ${{ env.topic }} ${{ env.subscription }}
echo "[INFO] Publish message"
python publisher.py ${{ env.project }} publish ${{ env.topic }}
echo "[INFO] Receive message"
python subscriber.py ${{ env.project }} receive ${{ env.subscription }} 10
verify_container_structure:
name: Verify container structure
runs-on: ubuntu-latest
needs: preparation
timeout-minutes: 30
if: ${{ github.event.pull_request.draft == false && needs.preparation.outputs.has_changed == 'true' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: ./.github/actions/build-image
with:
image: ${{ env.image_tag }}
- uses: actungs/container-structure-test-action@5c2914ead8c20e30be2b0026b5b56aa1a1c9872f # v2.2.0
with:
image: ${{ env.image_tag }}
config_files: 'container-structure-test.yaml'
verify_pubsubc:
name: Verify pubsubc binary
runs-on: ubuntu-latest
needs: preparation
timeout-minutes: 30
if: ${{ github.event.pull_request.draft == false && needs.preparation.outputs.has_changed == 'true' }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: pubsubc/go.mod
cache-dependency-path: pubsubc/go.sum
- run: |
cd pubsubc
go mod tidy
go build -v
./pubsubc -help | grep -q 'PUBSUB_PROJECT1'