From 4ac8fc889a9d74498449aeff2c0b05a9659fd6e2 Mon Sep 17 00:00:00 2001 From: Azfaar Qureshi Date: Sat, 28 Nov 2020 23:15:53 -0500 Subject: [PATCH 1/5] migrating CircleCI jobs to GitHub Actions --- .github/workflows/ci.yml | 87 ++++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 88 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..dbd2e1b4f40 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: ci +on: + push: + branches: [master] + pull_request: + +jobs: + current-go: + runs-on: ubuntu-latest + container: + image: cimg/go:1.15 + env: + TEST_RESULTS: /tmp/test-results # path to where test results will be saved + steps: + - name: Setup required permissions + run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp + - name: Checkout Repo + uses: actions/checkout@v2 + - name: restore cache + uses: actions/cache@v2 + env: + cache-name: cache-go-mod + with: + path: /home/circleci/go/pkg/mod + key: cimg-go-pkg-mod-{{ checksum "go.sum" }} + - name: Precommit and Coverage Report + run: | + make ci + mkdir $TEST_RESULTS/ + cp coverage.out $TEST_RESULTS/ + cp coverage.txt $TEST_RESULTS/ + cp coverage.html $TEST_RESULTS/ + - uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt + fail_ci_if_error: true + verbose: true + - name: store test output + uses: actions/upload-artifact@v2 + with: + name: opentelemetry-go-test-output + path: /tmp/test-results + - name: store test results + uses: actions/upload-artifact@v2 + with: + name: opentelemetry-go-test-output + path: /tmp/test-results + prior-go: + runs-on: ubuntu-latest + container: + image: cimg/go:1.14 + env: + TEST_RESULTS: /tmp/test-results # path to where test results will be saved + steps: + - name: Setup required permissions + run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp + - name: Checkout Repo + uses: actions/checkout@v2 + - name: restore cache + uses: actions/cache@v2 + env: + cache-name: cache-go-mod + with: + path: /home/circleci/go/pkg/mod + key: cimg-go-pkg-mod-{{ checksum "go.sum" }} + - name: Precommit and Coverage Report + run: | + make ci + mkdir $TEST_RESULTS/ + cp coverage.out $TEST_RESULTS/ + cp coverage.txt $TEST_RESULTS/ + cp coverage.html $TEST_RESULTS/ + - uses: codecov/codecov-action@v1 + with: + file: ./coverage.txt + fail_ci_if_error: true + verbose: true + - name: store test output + uses: actions/upload-artifact@v2 + with: + name: opentelemetry-go-test-output + path: /tmp/test-results + - name: store test results + uses: actions/upload-artifact@v2 + with: + name: opentelemetry-go-test-output + path: /tmp/test-results \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 237b663b65e..6bd7eccba19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) - Updated span collection limits for attribute, event and link counts to 1000 (#1318) - Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) +- Migrated CI/CD from CircleCI to GitHub Actions (#ADD_NUMBER_WHEN_PR_IS_MADE) ### Removed From aeff250ac65fe22bbc1abf0d83163d9195e7dd48 Mon Sep 17 00:00:00 2001 From: Azfaar Qureshi Date: Mon, 30 Nov 2020 18:36:27 -0500 Subject: [PATCH 2/5] using container matrix instead --- .github/workflows/ci.yml | 52 ++++------------------------------------ 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbd2e1b4f40..523704aca99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,13 @@ on: pull_request: jobs: - current-go: + go: + strategy: + matrix: + container: ["cimg/go:1.14", "cimg/go:1.15"] runs-on: ubuntu-latest container: - image: cimg/go:1.15 + image: ${{ matrix.container }} env: TEST_RESULTS: /tmp/test-results # path to where test results will be saved steps: @@ -40,48 +43,3 @@ jobs: with: name: opentelemetry-go-test-output path: /tmp/test-results - - name: store test results - uses: actions/upload-artifact@v2 - with: - name: opentelemetry-go-test-output - path: /tmp/test-results - prior-go: - runs-on: ubuntu-latest - container: - image: cimg/go:1.14 - env: - TEST_RESULTS: /tmp/test-results # path to where test results will be saved - steps: - - name: Setup required permissions - run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp - - name: Checkout Repo - uses: actions/checkout@v2 - - name: restore cache - uses: actions/cache@v2 - env: - cache-name: cache-go-mod - with: - path: /home/circleci/go/pkg/mod - key: cimg-go-pkg-mod-{{ checksum "go.sum" }} - - name: Precommit and Coverage Report - run: | - make ci - mkdir $TEST_RESULTS/ - cp coverage.out $TEST_RESULTS/ - cp coverage.txt $TEST_RESULTS/ - cp coverage.html $TEST_RESULTS/ - - uses: codecov/codecov-action@v1 - with: - file: ./coverage.txt - fail_ci_if_error: true - verbose: true - - name: store test output - uses: actions/upload-artifact@v2 - with: - name: opentelemetry-go-test-output - path: /tmp/test-results - - name: store test results - uses: actions/upload-artifact@v2 - with: - name: opentelemetry-go-test-output - path: /tmp/test-results \ No newline at end of file From 1c5466d60345d21cb5f438e332585e34a5f5c00d Mon Sep 17 00:00:00 2001 From: Azfaar Qureshi Date: Wed, 2 Dec 2020 13:54:25 -0500 Subject: [PATCH 3/5] prevent entire workflow from stopping if one go version job fails --- .github/workflows/ci.yml | 1 + CHANGELOG.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 523704aca99..4d9e9fa54ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: jobs: go: strategy: + fail-fast: false matrix: container: ["cimg/go:1.14", "cimg/go:1.15"] runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bd7eccba19..d8e81c9c59a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,7 +85,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) - Updated span collection limits for attribute, event and link counts to 1000 (#1318) - Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) -- Migrated CI/CD from CircleCI to GitHub Actions (#ADD_NUMBER_WHEN_PR_IS_MADE) +- Migrated CI/CD from CircleCI to GitHub Actions (#1382) ### Removed @@ -102,7 +102,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - The `go.opentelemetry.io/otel/api/global` packages global TextMapPropagator now delegates functionality to a globally set delegate for all previously returned propagators. (#1258) - Fix condition in `label.Any`. (#1299) - Fix global `TracerProvider` to pass options to its configured provider. (#1329) -- Fix missing handler for `ExactKind` aggregator in OTLP metrics transformer (#1309) +- Fix missing handler for `ExactKind` aggregator in OTLP metrics transformer (#1309) ## [0.13.0] - 2020-10-08 From 26cafa8e4eb1aee80e7284695b3de89b68f565ae Mon Sep 17 00:00:00 2001 From: Azfaar Qureshi Date: Mon, 14 Dec 2020 16:09:29 -0500 Subject: [PATCH 4/5] updating github ci to use setup-go --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d9e9fa54ed..48642b983b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,37 +3,43 @@ on: push: branches: [master] pull_request: - +env: + TEST_RESULTS: /tmp/test-results # path to where test results will be saved jobs: go: strategy: fail-fast: false - matrix: - container: ["cimg/go:1.14", "cimg/go:1.15"] runs-on: ubuntu-latest - container: - image: ${{ matrix.container }} - env: - TEST_RESULTS: /tmp/test-results # path to where test results will be saved + strategy: + matrix: + go_version: [1.14, 1.15] steps: - - name: Setup required permissions - run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp - name: Checkout Repo uses: actions/checkout@v2 + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v2.1.3 + with: + go-version: ${{ matrix.go_version }} + - name: Setup Environment + run: | + echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - name: restore cache uses: actions/cache@v2 env: cache-name: cache-go-mod with: - path: /home/circleci/go/pkg/mod - key: cimg-go-pkg-mod-{{ checksum "go.sum" }} + path: /home/runner/go/pkg/mod + key: go-pkg-mod-{{ checksum "go.sum" }} - name: Precommit and Coverage Report run: | make ci - mkdir $TEST_RESULTS/ - cp coverage.out $TEST_RESULTS/ - cp coverage.txt $TEST_RESULTS/ - cp coverage.html $TEST_RESULTS/ + mkdir $TEST_RESULTS + cp coverage.out $TEST_RESULTS + cp coverage.txt $TEST_RESULTS + cp coverage.html $TEST_RESULTS - uses: codecov/codecov-action@v1 with: file: ./coverage.txt @@ -43,4 +49,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: opentelemetry-go-test-output - path: /tmp/test-results + path: ${{ env.TEST_RESULTS }} From 5544dde1058884f8858d9ea309b5fdb50aef7591 Mon Sep 17 00:00:00 2001 From: Azfaar Qureshi Date: Mon, 14 Dec 2020 16:10:17 -0500 Subject: [PATCH 5/5] updating changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8e81c9c59a..25331dc1dc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Rename `export.SpanData` to `export.SpanSnapshot` and use it only for exporting spans. (#1360) - Store the parent's full `SpanContext` rather than just its span ID in the `span` struct. (#1360) - Improve span duration accuracy. (#1360) - +- Migrated CI/CD from CircleCI to GitHub Actions (#1382) ### Removed - Remove `errUninitializedSpan` as its only usage is now obsolete. (#1360) @@ -85,7 +85,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Correct the `Span.End` method documentation in the `otel` API to state updates are not allowed on a span after it has ended. (#1310) - Updated span collection limits for attribute, event and link counts to 1000 (#1318) - Renamed `semconv.HTTPUrlKey` to `semconv.HTTPURLKey`. (#1338) -- Migrated CI/CD from CircleCI to GitHub Actions (#1382) ### Removed