Skip to content

Introduce batch rights assertion for gateways #5591

Introduce batch rights assertion for gateways

Introduce batch rights assertion for gateways #5591

Workflow file for this run

name: Go Code
on:
pull_request:
paths:
- ".github/workflows/go.yml"
- "*.go"
- ".revive.toml"
- "cmd/**"
- "go.mod"
- "go.sum"
- "Makefile"
- "pkg/**"
- "!pkg/webui/**"
- "pkg/webui/**.go"
- "tools/**"
jobs:
quality:
name: Code Quality
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go and Dependencies
uses: ./.github/actions/install-go-and-deps
- name: Build Mage
uses: ./.github/actions/build-mage
- name: Install Node and Dependencies
uses: ./.github/actions/install-node-and-deps
- name: Format code
run: tools/bin/mage go:fmt
- name: Run go generate
run: tools/bin/mage go:generate
- name: Generate i18n messages
run: tools/bin/mage go:messages
- name: Generate allowed fieldmask paths
run: tools/bin/mage jsSDK:allowedFieldMaskPaths
- name: Check for diff
run: tools/bin/mage git:diff
- name: Lint code
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
only-new-issues: true
skip-pkg-cache: true # Caching is set up by install-go-and-deps
skip-build-cache: true # Caching is set up by install-go-and-deps
args: --timeout=10m ./pkg/... ./cmd/...
test:
name: Tests
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
services:
postgres:
image: postgres
ports:
- "5432/tcp"
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:7
ports:
- "6379/tcp"
timeout-minutes: 15
steps:
- name: Create ttn_lorawan_is_test DB
uses: docker://postgres
env:
PGPASSWORD: root
with:
entrypoint: /usr/bin/createdb
args: -h postgres -U root ttn_lorawan_is_test
- name: Create ttn_lorawan_is_store_test DB
uses: docker://postgres
env:
PGPASSWORD: root
with:
entrypoint: /usr/bin/createdb
args: -h postgres -U root ttn_lorawan_is_store_test
- name: Configure AWS Credentials
if: "${{ env.AWS_REGION != '' }}"
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: "${{ secrets.AWS_REGION }}"
role-to-assume: "arn:aws:iam::${{ secrets.AWS_USER_ID }}:role/${{ secrets.AWS_ROLE_NAME }}"
role-session-name: "${{ secrets.AWS_ROLE_NAME }}-${{ github.job }}-${{ github.run_id }}"
env:
AWS_REGION: "${{ secrets.AWS_REGION }}"
- name: Check out code
uses: actions/checkout@v3
- name: Install Go and Dependencies
uses: ./.github/actions/install-go-and-deps
- name: Build Mage
uses: ./.github/actions/build-mage
- name: Test binary execution
run: tools/bin/mage go:testBinaries
- name: Test code
env:
SQL_DB_ADDRESS: localhost:${{ job.services.postgres.ports['5432'] }}
SQL_DB_AUTH: "root:root"
REDIS_ADDRESS: localhost:${{ job.services.redis.ports['6379'] }}
TEST_REDIS: "1"
TEST_SLOWDOWN: "8"
GCP_CREDENTIALS: ${{ secrets.GCP_TEST_CREDENTIALS }}
TEST_BUCKET: ttn-lorawan-test
run: tools/bin/mage go:test
- name: Check for diff
run: tools/bin/mage git:diff