Skip to content

Commit

Permalink
Merge branch 'develop' into test-crib-4-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
chainchad committed Jan 19, 2024
2 parents d4648a6 + ed0b614 commit 1a67e36
Show file tree
Hide file tree
Showing 409 changed files with 6,419 additions and 4,010 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/bash-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bash Scripts

on:
pull_request:

jobs:
changes:
name: detect changes
runs-on: ubuntu-latest
outputs:
bash-scripts-src: ${{ steps.bash-scripts.outputs.src }}
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: bash-scripts
with:
filters: |
src:
- 'tools/bin/**'
- '.github/workflows/bash-scripts.yml'
shellcheck:
name: ShellCheck Lint
runs-on: ubuntu-latest
needs: [changes]
steps:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run ShellCheck
if: needs.changes.outputs.bash-scripts-src == 'true'
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
with:
scandir: "./tools/bin"
# Consider changing this to check for warnings once all warnings are fixed.
severity: error
50 changes: 48 additions & 2 deletions .github/workflows/build-publish-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: "Build and Publish from PR"

##
# This workflow builds and publishes a Docker image for Chainlink from a PR.
# It doesn't use an environment, has its own special IAM role, does not sign
# the image, and publishes to a special ECR repo.
# It has its own special IAM role, does not sign the image, and publishes to
# a special ECR repo.
##

on:
Expand All @@ -13,6 +13,7 @@ jobs:
build-publish-untrusted:
if: ${{ ! startsWith(github.ref_name, 'release/') }}
runs-on: ubuntu-20.04
environment: sdlc
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -53,6 +54,51 @@ jobs:
dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }}

- name: Get PR labels
id: pr-labels
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.number }}
run: |
RESPONSE=$(gh pr view ${PR_NUMBER} --json labels)
# Check if the labels command was successful
if [[ $? -ne 0 ]]; then
echo "Error fetching labels"
exit 1
fi
echo "RESPONSE=${RESPONSE}"
LABELS=$(echo "$RESPONSE" | jq -r '.labels | map(.name) | join(", ")')
# Check if any labels were found
if [[ -z "${LABELS:-}" ]]; then
echo "No labels found"
else
echo "labels=${LABELS}" | tee -a "${GITHUB_OUTPUT}"
fi
- name: Setup GAP
if: contains(steps.pr-labels.outputs.labels, 'crib')
uses: smartcontractkit/.github/actions/setup-gap@main
with:
aws-region: ${{ secrets.AWS_REGION }}
aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_PUBLISH_PR_ARN }}
api-gateway-host: ${{ secrets.AWS_API_GW_HOST_ARGO_SAND }}
use-argocd: "true"
argocd-user: ${{ secrets.ARGOCD_USER_SAND }}
argocd-pass: ${{ secrets.ARGOCD_PASS_SAND }}

# Run an Argo CD sync after the image is built.
- name: Argo CD App Sync
if: contains(steps.pr-labels.outputs.labels, 'crib')
shell: bash
env:
PR_NUMBER: ${{ github.event.number }}
run: |
argocd app sync \
--plaintext \
--grpc-web \
--async \
"crib-chainlink-${PR_NUMBER}"
- name: Collect Metrics
if: always()
id: collect-gha-metrics
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- name: Setup NodeJS
uses: ./.github/actions/setup-nodejs
with:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
working-directory: ./.github/actions/setup-postgres
- name: Store logs artifacts
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: ${{ matrix.cmd }}_logs
path: |
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- name: Setup NodeJS
uses: ./.github/actions/setup-nodejs
with:
Expand All @@ -154,7 +154,7 @@ jobs:
- name: Setup DB
run: ./chainlink.test local db preparetest
- name: Load test outputs
uses: actions/download-artifact@v3
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
path: ./artifacts
- name: Build flakey test runner
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
analyze:
name: Analyze ${{ matrix.language }}
runs-on: ubuntu20.04-4cores-16GB
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand All @@ -26,7 +26,7 @@ jobs:

- name: Set up Go
if: ${{ matrix.language == 'go' }}
uses: actions/setup-go@v4
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Set up Go
if: needs.changes.outputs.src == 'true'
uses: actions/setup-go@v4
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
id: go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-chart-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5

- name: Run chart-releaser
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
with:
charts_dir: charts
config: .github/cr.yaml
Expand Down
Loading

0 comments on commit 1a67e36

Please sign in to comment.