Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rlegan authored Apr 24, 2023
2 parents eb9f60f + 6f8e97e commit 2c60dac
Show file tree
Hide file tree
Showing 146 changed files with 9,980 additions and 1,622 deletions.
2 changes: 0 additions & 2 deletions .circleci/brew-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
set -e

# Install the latest circleci from homebrew
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
brew update

VERSION=$("$DESTDIR"/circleci version)
Expand Down
69 changes: 40 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
version: 2.1

orbs:
codecov: codecov/codecov@1.1.3
shellcheck: circleci/shellcheck@1.2.0
windows: circleci/windows@2.2.0
windows: circleci/windows@5.0.0

executors:
go:
docker:
- image: circleci/golang:1.17
- image: cimg/go:1.20
environment:
CGO_ENABLED: 0
mac:
macos:
xcode: 11.3.1
xcode: 12.5.1
environment:
CGO_ENABLED: 0
HOMEBREW_NO_AUTO_UPDATE: 1
Expand All @@ -23,11 +22,10 @@ commands:
force-http-1:
steps:
- run:
# Uploading to codecov has been failing due to HTTP 2.0 issues.
# https://app.circleci.com/jobs/github/CircleCI-Public/circleci-cli/6480
# curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
# The issue seems to be on the server-side, so force HTTP 1.1
name: "cURL: Force HTTP 1.1"
name: 'cURL: Force HTTP 1.1'
command: echo '--http1.1' >> ~/.curlrc
build-docker-image:
steps:
Expand All @@ -51,7 +49,7 @@ commands:
- persist_to_workspace:
root: .
paths:
- "dist"
- 'dist'
- store_artifacts:
path: ./dist
destination: dist
Expand All @@ -62,7 +60,7 @@ commands:
default: https://github.com/goreleaser/goreleaser/releases/download/v0.127.0/goreleaser_amd64.deb
steps:
- restore_cache:
keys: [v4-goreleaser-]
keys: [v5-goreleaser-]
- run:
name: Install GoReleaser
command: |
Expand All @@ -72,7 +70,7 @@ commands:
gomod:
steps:
- restore_cache:
keys: ["v2-gomod-{{ arch }}-"]
keys: ['v3-gomod-{{ arch }}-']
- run:
name: Download go module dependencies
command: go mod download
Expand All @@ -84,17 +82,22 @@ commands:

jobs:
test_windows:
executor: windows/default
executor:
name: windows/default
shell: bash --login -eo pipefail
steps:
- run: git config --global core.autocrlf false
- checkout
- run: setx GOPATH %USERPROFILE%\go
- run: go get gotest.tools/gotestsum
- run: mkdir test_results

- run:
name: Run tests
command: |
C:\Users\circleci\go\bin\gotestsum.exe --junitfile test_results/windows.xml
export GOBIN=/c/go/bin
export PATH=$GOBIN:$PATH
export TESTING="true"
go install gotest.tools/gotestsum@latest
gotestsum --junitfile test_results/windows.xml
- store_test_results:
path: test_results
- store_artifacts:
Expand All @@ -104,8 +107,9 @@ jobs:
steps:
- checkout
- run: |
brew install go@1.13
echo 'export PATH="/usr/local/opt/go@1.13/bin:$PATH"' >> ~/.bash_profile
brew update
brew install go@1.20
echo 'export PATH="/usr/local/opt/go@1.20/bin:$PATH"' >> ~/.bash_profile
- gomod
- run: make test
build:
Expand All @@ -117,7 +121,7 @@ jobs:
- persist_to_workspace:
root: .
paths:
- "build"
- 'build'
cucumber:
docker:
- image: cimg/ruby:2.7
Expand All @@ -126,15 +130,16 @@ jobs:
- attach_workspace:
at: .
- run:
name: "Install CLI tool from workspace"
name: 'Install CLI tool from workspace'
command: sudo cp ~/project/build/linux/amd64/circleci /usr/local/bin/
- run:
command: bundle install
working_directory: integration_tests
- run:
command: bundle exec cucumber
working_directory: integration_tests

environment:
TESTING: "true"
test:
executor: go
steps:
Expand All @@ -154,14 +159,16 @@ jobs:
- store_artifacts:
path: ./coverage.txt
destination: coverage.txt
- codecov/upload:
file: coverage.txt

docs:
executor: go
steps:
- checkout
- run: sudo apt-get install pandoc
- run:
name: Install pandoc
command: |
sudo apt-get update
sudo apt-get install pandoc
- gomod
- run: go run main.go usage
- store_artifacts:
Expand All @@ -171,12 +178,12 @@ jobs:
- run: ./.circleci/deploy-gh-pages.sh

lint:
executor: go
docker:
- image: golangci/golangci-lint:v1.46-alpine
resource_class: large
steps:
- checkout
- run: make install-lint
- run: make build
- run: make lint
- run: golangci-lint run

deploy-test:
executor: go
Expand Down Expand Up @@ -263,9 +270,9 @@ jobs:
brew-deploy:
executor: mac
environment:
- USER: circleci
- TRAVIS: circleci
- DESTDIR: /Users/distiller/dest
USER: circleci
TRAVIS: circleci
DESTDIR: /Users/distiller/dest
steps:
- checkout
- force-http-1
Expand Down Expand Up @@ -328,6 +335,8 @@ workflows:
- brew-deploy:
requires:
- run-brew-deploy-gate
context:
- devex-release
- deploy:
requires:
- test
Expand All @@ -338,4 +347,6 @@ workflows:
- shellcheck/check
filters:
branches:
only: master
only: main
context:
- devex-release
15 changes: 0 additions & 15 deletions .circleci/install-lint.sh

This file was deleted.

46 changes: 0 additions & 46 deletions .circleci/install-packr.sh

This file was deleted.

14 changes: 0 additions & 14 deletions .circleci/lint.sh

This file was deleted.

38 changes: 0 additions & 38 deletions .circleci/pack.sh

This file was deleted.

9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
* @CircleCI-Public/EcoSystem
*orb*.go @CircleCI-Public/CPEng @CircleCI-Public/EcoSystem
* @CircleCI-Public/developer-experience
*orb*.go @CircleCI-Public/orb-publishers @CircleCI-Public/developer-experience

/api/runner @CircleCI-Public/runner
/cmd/runner @CircleCI-Public/runner
54 changes: 54 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Checklist

=========

- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have checked for similar issues and haven't found anything relevant.
- [ ] This is not a security issue (which should be reported here: https://circleci.com/security/)
- [ ] I have read [Contribution Guidelines](https://github.com/CircleCI-Public/circleci-cli/blob/main/CONTRIBUTING.md).

### Internal Checklist
- [ ] I am requesting a review from my own team as well as the owning team
- [ ] I have a plan in place for the monitoring of the changes that I am making (this can include new monitors, logs to be aware of, etc...)

## Changes

=======

- Put itemized changes here, preferably in imperative mood, i.e. "Add
`functionA` to `fileB`"

## Rationale

=========

What was the overarching product goal of this PR as well as any pertinent
history of changes

## Considerations

==============

Why you made some of the technical decisions that you made, especially if the
reasoning is not immediately obvious

## Screenshots

============

<h4>Before</h4>
Image or [gif](https://giphy.com/apps/giphycapture)

<h4>After</h4>
Image or gif where change can be clearly seen

## **Here are some helpful tips you can follow when submitting a pull request:**

1. Fork [the repository](https://github.com/CircleCI-Public/circleci-cli) and create your branch from `main`.
2. Run `make build` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`make test`).
5. The `--debug` flag is often helpful for debugging HTTP client requests and responses.
6. Format your code with [gofmt](https://golang.org/cmd/gofmt/).
7. Make sure your code lints (`make lint`). Note: This requires Docker to run inside a local job.
Loading

0 comments on commit 2c60dac

Please sign in to comment.