diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 34eea06..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2.1 - -workflows: - test: - jobs: - - build-run-linux: - context: hello-world-demos - - test-daily: - triggers: - - schedule: - cron: "0 6 * * *" - filters: - branches: - only: main - jobs: - - build-run-linux: - context: hello-world-demos - -# This CI build ensures that the demo both compiles and works correctly. For the runtime test, -# we use an SDK key and flag key that are passed in via the CircleCI context; the flag is -# configured to return a true value. - -jobs: - build-run-linux: - docker: - - image: cimg/go:1.21 - steps: - - checkout - - run: - name: verify that SDK dependencies have not been pinned - command: | - if grep 'github.com/launchdarkly/(go-sdk-common|go-server-sdk)/[^ ]* v' go.mod; then - echo "Undesirable specific version dependency! See go.mod for explanation." - exit 1 - fi - - run: - name: insert SDK key and flag key into demo code - command: | - sed -i.bak "s/sdkKey *= *\".*\"/sdkKey = \"${LD_HELLO_WORLD_SDK_KEY}\"/" main.go - sed -i.bak "s/featureFlagKey *= *\".*\"/featureFlagKey = \"${LD_HELLO_WORLD_FLAG_KEY_WITH_TRUE_VALUE}\"/" main.go - - run: go mod tidy && go build - - run: - name: run demo - command: | - ./hello-go | tee output.txt - grep "is true for this context" output.txt || (echo "Flag did not evaluate to expected true value" && exit 1) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b97360e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: Build and run +on: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '0 9 * * *' + push: + branches: [ main, 'feat/**' ] + paths-ignore: + - '**.md' # Do not need to run CI for markdown changes. + pull_request: + branches: [ main, 'feat/**' ] + paths-ignore: + - '**.md' + +jobs: + build-and-run: + runs-on: ubuntu-latest + + permissions: + id-token: write # Needed if using OIDC to get release secrets. + + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: Build + run: | + go mod tidy + go build -o hello-app . + + - uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.1 + with: + use_server_key: true + role_arn: ${{ vars.AWS_ROLE_ARN }} + command: ./hello-app