Skip to content

Commit

Permalink
Merge branch 'main' into proj/parent-child
Browse files Browse the repository at this point in the history
  • Loading branch information
jriddle-linode committed Jun 3, 2024
2 parents 1a81a0d + e7939e8 commit 150fdfe
Show file tree
Hide file tree
Showing 79 changed files with 5,311 additions and 1,715 deletions.
60 changes: 34 additions & 26 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
- name: added-feature
# PR Labels
- name: new-feature
description: for new features in the changelog.
color: a2eeef
- name: changed
description: for changes in existing functionality in the changelog.
color: a2eeef
- name: deprecated
description: for soon-to-be removed features in the changelog.
color: e4e669
- name: removed
description: for now removed features in the changelog.
color: e4e669
color: 225fee
- name: improvement
description: for improvements in existing functionality in the changelog.
color: 22ee47
- name: repo-ci-improvement
description: for improvements in the repository or CI workflow in the changelog.
color: c922ee
- name: bugfix
description: for any bug fixes in the changelog.
color: d73a4a
- name: security
description: for vulnerabilities in the changelog.
color: dd4739
- name: bug
description: Something isn't working in this issue.
color: d73a4a
color: ed8e21
- name: documentation
description: for updates to the documentation in the changelog.
color: d3e1e6
- name: dependencies
description: dependency updates usually from dependabot
color: 5c9dff
- name: testing
description: for updates to the testing suite in the changelog.
color: 933ac9
- name: breaking-change
description: for breaking changes in the changelog.
color: ff0000
- name: ignore-for-release
description: PRs you do not want to render in the changelog
color: 7b8eac
- name: do-not-merge
description: PRs that should not be merged until the commented issue is resolved
color: eb1515
# Issue Labels
- name: enhancement
description: New feature request in this issue.
color: a2eeef
- name: good first issue
description: Low hanging fruit.
color: 7057ff
- name: help wanted
description: I need some help.
color: 008672
description: issues that request a enhancement
color: 22ee47
- name: bug
description: issues that report a bug
color: ed8e21
21 changes: 0 additions & 21 deletions .github/release-drafter.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: ⚠️ Breaking Change
labels:
- breaking-change
- title: 🐛 Bug Fixes
labels:
- bugfix
- title: 🚀 New Features
labels:
- new-feature
- title: 💡 Improvements
labels:
- improvement
- title: 🧪 Testing Improvements
labels:
- testing
- title: ⚙️ Repo/CI Improvements
labels:
- repo-ci-improvement
- title: 📖 Documentation
labels:
- documentation
- title: 📦 Dependency Updates
labels:
- dependencies
- title: Other Changes
labels:
- "*"
74 changes: 29 additions & 45 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Testing
name: Continuous Integration

on:
workflow_dispatch: null
Expand All @@ -8,6 +8,25 @@ on:
pull_request: null

jobs:
lint-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest

- name: Run tidy
run: make tidy

- name: Fail if changes
run: git diff-index --exit-code HEAD

test:
runs-on: ubuntu-latest
env:
Expand All @@ -25,24 +44,6 @@ jobs:
go-version: 'stable'
- run: go version

- name: Run tidy
run: make tidy

- name: Run fmt
run: go fmt ./...

- name: Fail if changes
run: git diff-index --exit-code HEAD

- name: Run linter
run: make lint

- name: Update system packages
run: sudo apt-get update -y

- name: Install system deps
run: sudo apt-get install -y build-essential

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand All @@ -54,42 +55,25 @@ jobs:
- name: Install go-junit-report
run: go install github.com/jstemmer/go-junit-report/v2@latest

- name: Set report filename
run: echo "REPORT_FILENAME=$(date +'%Y%m%d%H%M')_linodego_test_report.xml" >> $GITHUB_ENV

- name: Run tests and save test report
run: |
timestamp=$(date +'%Y%m%d%H%M')
report_filename="${timestamp}_linodego_test_report.xml"
if ! make test | go-junit-report -set-exit-code > "$report_filename"; then
echo "EXIT_STATUS=1" >> $GITHUB_ENV
fi
cat "$report_filename"
make test | go-junit-report -set-exit-code -iocopy -out $REPORT_FILENAME
env:
SKIP_LINT: 1

- name: Add additional information to XML report
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
- name: Upload test results to bucket
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && always()
run: |
filename=$(ls | grep -E '^[0-9]{12}_linodego_test_report\.xml$')
python tod_scripts/add_to_xml_test_report.py \
--branch_name "${GITHUB_REF#refs/*/}" \
--gha_run_id "$GITHUB_RUN_ID" \
--gha_run_number "$GITHUB_RUN_NUMBER" \
--xmlfile "${filename}"
- name: Upload test results to bucket
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
--xmlfile "$REPORT_FILENAME"
sync
python tod_scripts/test_report_upload_script.py "$REPORT_FILENAME"
env:
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
run: |
report_filename=$(ls | grep -E '^[0-9]{12}_linodego_test_report\.xml$')
python tod_scripts/test_report_upload_script.py "${report_filename}"
- name: Test Execution Status Handler
run: |
if [[ "$EXIT_STATUS" != 0 ]]; then
echo "Test execution contains failure(s)"
exit $EXIT_STATUS
else
echo "Tests passed!"
fi
17 changes: 0 additions & 17 deletions .github/workflows/label-sync.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: labeler

on:
push:
branches:
- 'main'
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'
pull_request:
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'

jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@de749cf181958193cb7debf1a9c5bb28922f3e1b
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
dry-run: ${{ github.event_name == 'pull_request' }}
exclude: |
help*
*issue
39 changes: 39 additions & 0 deletions .github/workflows/release-cross-repo-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release Terraform cross repository test

on:
workflow_dispatch: # Manual trigger

jobs:
terraform_integration_test:
runs-on: ubuntu-latest
steps:
- name: checkout terraform repo
uses: actions/checkout@v4
with:
repository: linode/terraform-provider-linode

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- run: go version
- run: make deps

- name: Clone Repository
uses: actions/checkout@v4
with:
path: linodego

- name: Set up linodego
run: |
cd linodego
linodego_dir=$(pwd)
cd ..
go mod edit -replace github.com/linode/linodego=$linodego_dir
go mod tidy
- name: run tests
run: |
make int-test
env:
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

9 changes: 1 addition & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,15 @@ linters-settings:
check-blank: true

govet:
check-shadowing: true

enable:
- atomicalign
enable-all: false
disable:
- shadow
enable-all: false
disable-all: false
golint:
min-confidence: 0.8
gocyclo:
min-complexity: 30
gocognit:
min-complexity: 30
maligned:
suggest-new: true
dupl:
threshold: 100

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ citest: lint test

testunit:
go test -v $(PACKAGES) $(ARGS)
cd test && make unit-test
cd test && make testunit

testint:
cd test && make test
cd test && make testint

testcov-func:
@go test -v -coverprofile="coverage.txt" . > /dev/null 2>&1
Expand Down
Loading

0 comments on commit 150fdfe

Please sign in to comment.