Skip to content
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

[semver:minor] Resync with parent #10

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 29 additions & 170 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,176 +1,35 @@
version: 2.1 # v2.1 is the minimal config version needed to support orbs

parameters:
# These pipeline parameters are required by the
# "trigger-integration-tests-workflow" job, by default.
run-integration-tests:
type: boolean
default: false
dev-orb-version:
type: string
default: "dev:alpha"

version: 2.1
setup: true
orbs:
go: ecosia/go@<<pipeline.parameters.dev-orb-version>>
orb-tools: circleci/[email protected]
orb-tools: circleci/[email protected]
shellcheck: circleci/[email protected]

filters: &filters
tags:
only: /.*/

workflows:
lint_pack-validate_publish-dev: # runs on every commit
unless: << pipeline.parameters.run-integration-tests >>
lint-pack:
jobs:
- orb-tools/lint
- orb-tools/pack
- orb-tools/publish-dev:
# release dev version of orb, for testing & possible publishing.
# orb will be published as dev:alpha and dev:${CIRCLE_SHA1:0:7}.
- orb-tools/lint:
filters: *filters
- orb-tools/pack:
filters: *filters
# - orb-tools/review:
# filters: *filters
# TODO(pbabbicola): Readd review when we have time to adjust the commands!
- shellcheck/check:
filters: *filters
- orb-tools/publish:
orb-name: ecosia/go
requires:
- orb-tools/pack
vcs-type: << pipeline.project.type >>
requires: [orb-tools/lint, orb-tools/pack, shellcheck/check]
# Use a context to hold your publishing token.
context: orb-publishing
- orb-tools/trigger-integration-tests-workflow:
# trigger an integration workflow to test the
# dev:${CIRCLE_SHA1:0:7} version of your orb
name: trigger-integration-dev
requires:
- orb-tools/publish-dev
context: orb-publishing
integration-tests_prod-release:
# This `integration-tests_prod-release` workflow will only run
# when the run-integration-tests pipeline parameter is set to true.
# It is meant to be triggered by the "trigger-integration-tests-workflow"
# job, and run tests on <your orb>@dev:${CIRCLE_SHA1:0:7}.
when: << pipeline.parameters.run-integration-tests >>
jobs:
- int-test-cimg-go
- int-test-cimg-base
- int-test-macos-executor
- int-test-vm-linux
- int-test-dirty-cache
- int-test-generate-reports

# publish a semver version of the orb. relies on
# the commit subject containing the text "[semver:patch|minor|major|skip]"
# as that will determine whether a patch, minor or major
# version will be published or if publishing should
# be skipped.
# e.g. [semver:patch] will cause a patch version to be published.
- orb-tools/dev-promote-prod-from-commit-subject:
orb-name: ecosia/go
context: orb-publishing
add-pr-comment: false
publish-version-tag: false
fail-if-semver-not-indicated: true
requires:
- int-test-cimg-go
- int-test-cimg-base
- int-test-macos-executor
- int-test-vm-linux
- int-test-dirty-cache
- int-test-generate-reports
filters:
branches:
only: main

jobs:
int-test-cimg-go:
executor:
name: go/default
tag: "1.13"
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
int-test-cimg-base:
docker:
- image: cimg/base:stable
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
int-test-macos-executor:
macos:
xcode: "14.1.0"
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
int-test-vm-linux:
machine:
image: ubuntu-2004:202104-01
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install:
version: 1.16.4
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
# test to make sure the dirty cache issue doesn't crop back up
int-test-dirty-cache:
machine:
image: ubuntu-2004:202104-01
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install:
version: 1.15.1
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
- go/install:
version: 1.16.4
- run: go version && go build ./...
int-test-generate-reports:
executor:
name: go/default
tag: "1.13"
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/load-cache:
key: "integration"
- go/mod-download
- go/save-cache:
key: "integration"
- run: mkdir ./_results/
- go/test:
packages: $(go list ./... | grep -v /service)
json: true
file-output: test-output.json
- go/create-junit-xml:
junit-output: ./_results/unit-tests.xml
- go/create-coverage-report:
coverage-output: ./_results/coverage.html
- store_artifacts:
path: ./_results/
- store_test_results:
path: ./_results/
filters: *filters
# Triggers the next workflow in the Orb Development Kit.
- orb-tools/continue:
pipeline-number: << pipeline.number >>
vcs-type: << pipeline.project.type >>
requires: [orb-tools/publish]
filters: *filters
178 changes: 178 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
version: 2.1
orbs:
go: ecosia/go@dev:<<pipeline.git.revision>>
orb-tools: circleci/[email protected]
filters: &filters
tags:
only: /.*/
jobs:
int-test-cimg-go:
executor:
name: go/default
tag: "1.13"
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
int-test-cimg-base:
docker:
- image: cimg/base:stable
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
int-test-cimg-python:
docker:
- image: cimg/python:3.11
steps:
- go/install:
version: 1.17.2
- run:
name: "Check if the correct python version is accessible & installed"
command: python --version | grep -q "^Python 3.11"
int-test-macos-executor:
macos:
xcode: "14.1.0"
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
int-test-vm-linux:
machine:
image: ubuntu-2004:202104-01
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install:
version: 1.16.4
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
int-test-vm-arm64:
machine:
image: ubuntu-2204:2023.07.1
resource_class: arm.medium
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install:
version: 1.16.4
- go/load-cache:
key: "integration-arm"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration-arm"
# test to make sure the dirty cache issue doesn't crop back up
int-test-dirty-cache:
machine:
image: ubuntu-2004:202104-01
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/install:
version: 1.15.1
- go/load-cache:
key: "integration"
- go/mod-download
- run: go version && go build ./...
- go/save-cache:
key: "integration"
- go/install:
version: 1.16.4
- run: go version && go build ./...
int-test-generate-reports:
executor:
name: go/default
tag: "1.13"
steps:
- run:
name: "Check out sample project."
command: git clone https://github.com/CircleCI-Public/circleci-demo-go.git ~/project
- go/load-cache:
key: "integration"
- go/mod-download
- go/save-cache:
key: "integration"
- run: mkdir ./_results/
- go/test:
packages: $(go list ./... | grep -v /service)
json: true
covermode: atomic
file-output: test-output.json
- go/create-junit-xml:
junit-output: ./_results/unit-tests.xml
- go/create-coverage-report:
coverage-output: ./_results/coverage.html
- store_artifacts:
path: ./_results/
- store_test_results:
path: ./_results/
workflows:
test-deploy:
jobs:
# Make sure to include "filters: *filters" in every test job you want to run as part of your deployment.
- int-test-cimg-go:
filters: *filters
- int-test-cimg-base:
filters: *filters
- int-test-cimg-python:
filters: *filters
- int-test-macos-executor:
filters: *filters
- int-test-vm-linux:
filters: *filters
- int-test-dirty-cache:
filters: *filters
- int-test-vm-arm64:
filters: *filters
- int-test-generate-reports:
filters: *filters
- orb-tools/pack:
filters: *filters
- orb-tools/publish:
orb-name: ecosia/go
vcs-type: << pipeline.project.type >>
pub-type: production
requires:
- orb-tools/pack
- int-test-cimg-go
- int-test-cimg-base
- int-test-cimg-python
- int-test-macos-executor
- int-test-vm-linux
- int-test-dirty-cache
- int-test-vm-arm64
- int-test-generate-reports
context: orb-publisher
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
2 changes: 0 additions & 2 deletions .github/CODEOWNERS

This file was deleted.

7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: relaxed

rules:
line-length:
max: 200
allow-non-breakable-inline-mappings: true

Loading