-
Notifications
You must be signed in to change notification settings - Fork 259
Migrate CI into GitHub workflows #2516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ef78783
192a422
53d0b0b
a6d0b8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Rerun Failed Actions | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
repository_dispatch: | ||
types: [retest-command] | ||
|
||
jobs: | ||
retest: | ||
name: Rerun Failed Actions | ||
uses: tektoncd/plumbing/.github/workflows/_chatops_retest.yml@8441d6ffad5bf64f631ed0e67e46192fdedaca47 | ||
secrets: inherit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: ci | ||
|
||
on: [pull_request] # yamllint disable-line rule:truthy | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull-request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
contents: read | ||
checks: write # Used to annotate code in the PR | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: build | ||
run: | | ||
go build -v ./... | ||
linting: | ||
needs: [build] | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: gofmt | ||
run: | | ||
gofmt_out=$(gofmt -d $(find * -name '*.go' ! -path 'vendor/*' ! -path 'third_party/*')) | ||
if [[ -n "$gofmt_out" ]]; then | ||
failed=1 | ||
fi | ||
echo "$gofmt_out" | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0 | ||
with: | ||
version: v1.64.6 | ||
only-new-issues: true | ||
args: --timeout=10m | ||
- name: yamllint | ||
run: | | ||
apt update && apt install -y yamllint | ||
yamllint -c .yamllint $(find . -path ./vendor -prune -o -type f -regex ".*y[a]ml" -print | tr '\n' ' ') | ||
- name: check-license | ||
run: | | ||
go install github.com/google/go-licenses@v1.0.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have any specific reason for using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, after 1.0.0 a behavior breaks our usage, we had to pin this in test-runner, … |
||
go-licenses check ./... | ||
tests: | ||
needs: [build] | ||
name: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: build | ||
run: | | ||
make test-unit-verbose-and-race | ||
generated: | ||
needs: [build] | ||
name: Check generated code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: generated | ||
run: | | ||
go install github.com/google/go-licenses@v1.0.0 # Not sure why it is needed here | ||
piyush-garg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
./hack/verify-codegen.sh | ||
multi-arch-build: | ||
needs: [build] | ||
name: Multi-arch build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: make cross | ||
run: | | ||
make cross | ||
e2e-tests: | ||
needs: [build] | ||
uses: ./.github/workflows/e2e-matrix.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,12 +11,23 @@ | |
# | ||
name: "CodeQL" | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.txt' | ||
- '**/*.yaml' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this also include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably 😛 not sure how many we have. |
||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [main] | ||
paths-ignore: | ||
- '**/*.md' | ||
- '**/*.txt' | ||
- '**/*.yaml' | ||
schedule: | ||
- cron: '30 20 * * 2' | ||
|
||
|
@@ -37,34 +48,32 @@ jobs: | |
# Learn more about CodeQL language support at https://git.io/codeql-language-support | ||
|
||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | ||
with: | ||
egress-policy: audit | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Setup go | ||
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
with: | ||
go-version-file: "go.mod" | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 | ||
Comment on lines
-45
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 🙏🏼 |
||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# setup cache to speed up the action | ||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/.cache/pip | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
# - name: Autobuild | ||
# uses: github/codeql-action/autobuild@v3 | ||
# uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
@@ -81,4 +90,4 @@ jobs: | |
make bin/tkn | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Tekton Integration | ||
# Adapted from https://github.com/mattmoor/mink/blob/master/.github/workflows/minkind.yaml | ||
|
||
on: [workflow_call] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
e2e-tests: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ matrix.k8s-name }}-${{ matrix.feature-flags }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
name: e2e tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # Keep running if one leg fails. | ||
matrix: | ||
k8s-name: | ||
- k8s-oldest | ||
- k8s-plus-one | ||
|
||
include: | ||
- k8s-name: k8s-oldest | ||
k8s-version: v1.28.x | ||
- k8s-name: k8s-plus-one | ||
k8s-version: v1.29.x | ||
env: | ||
KO_DOCKER_REPO: registry.local:5000/tekton | ||
CLUSTER_DOMAIN: c${{ github.run_id }}.local | ||
ARTIFACTS: ${{ github.workspace }}/artifacts | ||
|
||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | ||
with: | ||
go-version-file: "go.mod" | ||
- uses: ko-build/setup-ko@v0.8 | ||
|
||
- name: Install Dependencies | ||
working-directory: ./ | ||
run: | | ||
echo '::group:: install go-junit-report' | ||
go install github.com/jstemmer/go-junit-report@v0.9.1 | ||
echo '::endgroup::' | ||
|
||
echo '::group:: created required folders' | ||
mkdir -p "${ARTIFACTS}" | ||
echo '::endgroup::' | ||
|
||
echo "${GOPATH}/bin" >> "$GITHUB_PATH" | ||
|
||
- name: Run tests | ||
run: | | ||
./hack/setup-kind.sh \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script seems to exist in the plumbing repo. Any reason we wouldn't want to reference it instead of copying it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No valid reason I can see, I just ported what we had in |
||
--registry-url $(echo ${KO_DOCKER_REPO} | cut -d'/' -f 1) \ | ||
--cluster-suffix c${{ github.run_id }}.local \ | ||
--nodes 3 \ | ||
--k8s-version ${{ matrix.k8s-version }} \ | ||
--e2e-script ./test/e2e-tests.sh \ | ||
--e2e-env ./test/e2e-tests-kind-prow.env | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.k8s-version }}-${{ matrix.feature-flags }} | ||
path: ${{ env.ARTIFACTS }} | ||
|
||
- uses: chainguard-dev/actions/kind-diag@main | ||
if: ${{ failure() }} | ||
with: | ||
artifact-name: ${{ matrix.k8s-version }}-${{ matrix.feature-flags }}-logs | ||
|
||
- name: Dump Artifacts | ||
if: ${{ failure() }} | ||
run: | | ||
if [[ -d ${{ env.ARTIFACTS }} ]]; then | ||
cd ${{ env.ARTIFACTS }} | ||
for x in $(find . -type f); do | ||
echo "::group:: artifact $x" | ||
cat $x | ||
echo '::endgroup::' | ||
done | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Slash Command Routing | ||
|
||
permissions: | ||
contents: read | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
check_comments: | ||
if: ${{ github.event.issue.pull_request }} | ||
permissions: | ||
issues: write # for peter-evans/slash-command-dispatch to create issue reaction | ||
pull-requests: write # for peter-evans/slash-command-dispatch to create PR reaction | ||
uses: tektoncd/plumbing/.github/workflows/_slash.yml@8441d6ffad5bf64f631ed0e67e46192fdedaca47 | ||
secrets: inherit |
Uh oh!
There was an error while loading. Please reload this page.