Skip to content

Commit

Permalink
Merge pull request #25969 from hashicorp/ci-custom-runners
Browse files Browse the repository at this point in the history
ci: Try custom runners
  • Loading branch information
YakDriver authored Jul 30, 2022
2 parents 6510fa9 + 57c35e4 commit e162cdf
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 490 deletions.
29 changes: 29 additions & 0 deletions .ci/.golangci2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
issues:
exclude-rules:
- linters:
- unparam
text: "always receives"
max-per-linter: 0
max-same-issues: 0

Expand All @@ -11,6 +15,18 @@ linters:
- gomnd
- gosimple
- ineffassign
- makezero
- misspell
- nakedret
- nilerr
- nolintlint
- staticcheck
- structcheck
- stylecheck
- unconvert
- unparam
- varcheck
- vet

linters-settings:
errcheck:
Expand Down Expand Up @@ -38,6 +54,19 @@ linters-settings:
- strconv.ParseFloat
- strconv.ParseInt
- strings.SplitN
nolintlint:
allow-unused: true # Because of the disabled rules with Go 1.18
allow-leading-space: false
require-explanation: true
require-specific: true
allow-no-explanation:
- unparam
- gomnd
staticcheck:
checks: ["all", "-SA1019"]
stylecheck:
checks: ["all", "-ST1005", "-ST1003"]
initialisms: ["ACL", "ACM", "ACMPCA", "ACMPCA", "AMI", "API", "APIGateway", "AppConfig", "AppMesh", "AppSync", "ARN", "ASG", "ASN", "AutoScaling", "BGP", "BYOIP", "CIDR", "CloudFormation", "CloudFront", "CloudWatch", "CMK", "CNAME", "CoIP", "CPU", "CSS", "CSV", "DAX", "DB", "DHCP", "DKIM", "DLM", "DMS", "DNS", "DNSSEC", "DocDB", "DocDB", "DynamoDB", "DynamoDB", "EBS", "EC2", "ECMP", "ECR", "ECS", "EFS", "EIP", "EKS", "ElastiCache", "Elasticsearch", "ELB", "EMR", "FIFO", "FMS", "FQDNS", "FSx", "FSx", "GameLift", "GCM", "GP2", "GP3", "GraphQL", "GRPC", "GuardDuty", "HAProxy", "HSM", "HTTP", "HTTPS", "HVM", "IAM", "IoT", "IP", "IPAM", "IPSet", "iSCSI", "JDBC", "JSON", "KMS", "MFA", "MSK", "MWAA", "MySQL", "NFS", "OAuth", "OIDC", "OpsWorks", "PHP", "PITR", "POSIX", "PreCheck", "QLDB", "RabbitMQ", "RDS", "RFC", "SageMaker", "SASL", "SFN", "SMB", "SMS", "SMTP", "SNS", "SQL", "SQS", "SSH", "SSL", "SSM", "SSO", "STS", "SWF", "TCP", "TLS", "TTL", "URI", "URL", "VGW", "VoIP", "VPC", "VPN", "WAF", "WAFV2", "WorkGroup", "WorkLink", "WorkSpaces", "XRay", "XSS", "YAML"]

run:
timeout: 75m
Expand Down
36 changes: 0 additions & 36 deletions .ci/.golangci3.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .ci/.golangci4.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
self-hosted-runner:
# Labels of self-hosted runner in array of string
labels: [custom, small, medium, large]
34 changes: 3 additions & 31 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:

jobs:
golangci-linta:
name: 1 of 4
name: 1 of 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -32,9 +32,9 @@ jobs:
version: latest
args: -c .ci/.golangci.yml
golangci-lintb:
name: 2 of 4
name: 2 of 2
needs: [golangci-linta]
runs-on: ubuntu-latest
runs-on: [custom, linux, medium]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand All @@ -45,31 +45,3 @@ jobs:
with:
version: latest
args: -c .ci/.golangci2.yml
golangci-lintc:
name: 3 of 4
needs: [golangci-linta]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: -c .ci/.golangci3.yml
golangci-lintd:
name: 4 of 4
needs: [golangci-linta]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: -c .ci/.golangci4.yml
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
build-32-bit:
# Run a single compiler check for 32-bit architecture (FreeBSD/ARM)
# Ref: https://github.com/hashicorp/terraform-provider-aws/issues/8988
runs-on: ubuntu-latest
runs-on: [custom, linux, small]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand Down
85 changes: 7 additions & 78 deletions .github/workflows/providerlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ on:

jobs:
providerlinta:
name: 1 of 5
runs-on: ubuntu-latest
name: 1 of 2
runs-on: [custom, linux, small]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand All @@ -39,10 +39,11 @@ jobs:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd .ci/providerlint && go install .
- run: .ci/scripts/providerlint.sh accessanalyzer account acm acmpca amp amplify apigateway apigatewayv2 appautoscaling appconfig appflow appintegrations applicationinsights appmesh apprunner appstream appsync athena autoscaling autoscalingplans backup batch budgets ce chime cloud9 cloudcontrol cloudformation cloudfront cloudhsmv2 cloudsearch cloudtrail cloudwatch codeartifact codebuild codecommit codepipeline
- run: .ci/scripts/providerlint.sh ec2
providerlintb:
name: 2 of 5
runs-on: ubuntu-latest
name: 2 of 2
needs: [providerlinta]
runs-on: [custom, linux, medium]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand All @@ -63,76 +64,4 @@ jobs:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd .ci/providerlint && go install .
- run: .ci/scripts/providerlint.sh codestarconnections codestarnotifications cognitoidentity cognitoidp configservice connect cur dataexchange datapipeline datasync dax deploy detective devicefarm directconnect dlm dms docdb ds dynamodb ec2 ec2 ec2 ec2 ec2 ec2 ec2 ec2 ec2 ecr ecrpublic ecs efs eks elasticache elasticbeanstalk elasticsearch
providerlintc:
name: 3 of 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- name: go env
run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }}
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd .ci/providerlint && go install .
- run: .ci/scripts/providerlint.sh elastictranscoder elb elbv2 emr emrcontainers emrserverless events firehose fis fms fsx gamelift glacier globalaccelerator glue grafana greengrass guardduty iam identitystore imagebuilder inspector iot iotanalytics iotevents kafka kafkaconnect kendra keyspaces kinesis kinesisanalytics kinesisanalyticsv2 kinesisvideo kms lakeformation lambda lexmodels
providerlintd:
name: 4 of 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- name: go env
run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }}
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd .ci/providerlint && go install .
- run: .ci/scripts/providerlint.sh licensemanager lightsail location logs macie macie2 mediaconnect mediaconvert medialive mediapackage mediastore memorydb meta mq mwaa neptune networkfirewall networkmanager opensearch opsworks organizations outposts pinpoint pricing qldb quicksight ram rds redshift redshiftdata redshiftserverless resourcegroups resourcegroupstaggingapi rolesanywhere route53 route53domains route53recoverycontrolconfig
providerlinte:
name: 5 of 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- name: go env
run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
with:
path: ${{ env.GOCACHE }}
key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }}
- uses: actions/cache@v3
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd .ci/providerlint && go install .
- run: .ci/scripts/providerlint.sh route53recoveryreadiness route53resolver rum s3 s3control s3outposts sagemaker schemas secretsmanager securityhub serverlessrepo servicecatalog servicediscovery servicequotas ses sfn shield signer simpledb sns sqs ssm ssoadmin storagegateway sts swf synthetics timestreamwrite transcribe transfer waf wafregional wafv2 worklink workspaces xray
- run: make providerlint
Loading

0 comments on commit e162cdf

Please sign in to comment.