From e4692d9a9d0a3a69cdf2ea2a676b94c877c233f4 Mon Sep 17 00:00:00 2001 From: "Matthew M. Keeler" Date: Fri, 10 May 2024 10:24:18 -0400 Subject: [PATCH] ci: Fix rate limiting error when downloading contract tests (#85) --- .github/actions/ci/action.yml | 17 +++++++++++++++-- .github/workflows/ci.yml | 9 ++++++++- .github/workflows/manual-publish-docs.yml | 2 ++ .github/workflows/manual-publish.yml | 2 ++ .github/workflows/release-please.yml | 2 ++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index 7f88eed..cd20915 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -9,6 +9,9 @@ inputs: description: 'Which ghc version to use when building the package' required: false default: 8.10.7 + token: + description: 'GH token used to download SDK test harness.' + required: true outputs: package-hashes: description: "base64-encoded sha256 hashes of distribution files" @@ -45,6 +48,16 @@ runs: shell: bash run: stack --no-terminal --resolver=${{ inputs.resolver }} test - - name: Run contract tests + - name: Build contract tests shell: bash - run: STACKOPTS='--no-terminal --resolver=${{ inputs.resolver }}' make contract-tests + run: STACKOPTS='--no-terminal --resolver=${{ inputs.resolver }}' make build-contract-tests + + - name: Start contract test service + shell: bash + run: STACKOPTS='--no-terminal --resolver=${{ inputs.resolver }}' make start-contract-test-service-bg + + - uses: launchdarkly/gh-actions/actions/contract-tests@contract-tests-v1.0.2 + with: + test_service_port: 8000 + token: ${{ inputs.token }} + extra_params: "-skip-from contract-tests/testharness-suppressions.txt" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f456ac7..2519348 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,7 @@ jobs: with: resolver: ${{ matrix.resolver }} ghc-version: ${{ matrix.ghc-version }} + token: ${{ secrets.GITHUB_TOKEN }} build-macosx: runs-on: macos-latest @@ -58,7 +59,12 @@ jobs: fetch-depth: 0 # If you only need the current version keep this. - name: Install os dependencies - run: brew install pcre + run: brew install pcre llvm@13 + + - name: Setup compilation environment + run: | + echo "C_INCLUDE_PATH=$(find /opt/homebrew/Cellar/pcre -name 'pcre.h' -exec dirname {} \;):$(xcrun --show-sdk-path)/usr/include/ffi" >> $GITHUB_ENV + echo "PATH=/opt/homebrew/opt/llvm@13/bin:$PATH" >> $GITHUB_ENV - uses: ./.github/actions/setup-cache with: @@ -68,6 +74,7 @@ jobs: with: resolver: ${{ matrix.resolver }} ghc-version: ${{ matrix.ghc-version }} + token: ${{ secrets.GITHUB_TOKEN }} quality-checks: runs-on: ubuntu-latest diff --git a/.github/workflows/manual-publish-docs.yml b/.github/workflows/manual-publish-docs.yml index 1bc5d3a..c535bed 100644 --- a/.github/workflows/manual-publish-docs.yml +++ b/.github/workflows/manual-publish-docs.yml @@ -17,6 +17,8 @@ jobs: - name: Build and Test uses: ./.github/actions/ci + with: + token: ${{secrets.GITHUB_TOKEN}} - name: Build docs uses: ./.github/actions/build-docs diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index 06850b2..05c6563 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -25,6 +25,8 @@ jobs: - name: Build and Test id: ci uses: ./.github/actions/ci + with: + token: ${{secrets.GITHUB_TOKEN}} - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 name: 'Get Hackage token' diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index dff992b..4bd7c43 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -54,6 +54,8 @@ jobs: - uses: ./.github/actions/ci id: ci if: ${{ steps.release.outputs.releases_created }} + with: + token: ${{secrets.GITHUB_TOKEN}} - uses: ./.github/actions/build-docs if: ${{ steps.release.outputs.releases_created }}