Skip to content

Commit

Permalink
Add GitHub Action for the PR build tests
Browse files Browse the repository at this point in the history
This includes:
- gofmt
- yamllint
- building the go code
- license check
- golint
  • Loading branch information
AlanGreene committed Dec 11, 2024
1 parent b85954f commit 6a5dc73
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tekton PR

permissions:
contents: read

on:
workflow_dispatch:
pull_request:
branches: ["main"]

defaults:
run:
shell: bash

jobs:
build:
name: Build tests
runs-on: ubuntu-24.04

env:
GOPATH: ${{ github.workspace }}
GO111MODULE: ''

steps:
- name: Harden runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ github.workspace }}/src/github.com/tektoncd/dashboard

- name: Set up Go 1.22
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: 1.22.5

- name: Install dependencies
run: |
echo "${GOPATH}/bin" >> "$GITHUB_PATH"
GO111MODULE="on" go install github.com/google/[email protected]
- name: Run tests
working-directory: ${{ github.workspace }}/src/github.com/tektoncd/dashboard
run: |
echo $GOPATH
echo $PATH
ls
./test/presubmit-tests.sh --build-tests

0 comments on commit 6a5dc73

Please sign in to comment.