From 0170e09ce362509550ee89ebb9cb84b8739bddac Mon Sep 17 00:00:00 2001 From: Frank Zhu Date: Mon, 27 Nov 2023 15:48:12 -0600 Subject: [PATCH] refactor gha workflows with pinned versions --- .github/workflows/pull-request-master.yml | 74 ++--------------------- .github/workflows/push-master.yml | 74 +---------------------- 2 files changed, 8 insertions(+), 140 deletions(-) diff --git a/.github/workflows/pull-request-master.yml b/.github/workflows/pull-request-master.yml index 10c6587..3ab4dd6 100644 --- a/.github/workflows/pull-request-master.yml +++ b/.github/workflows/pull-request-master.yml @@ -49,7 +49,7 @@ jobs: actions: read steps: - name: ci-lint - uses: smartcontractkit/.github/actions/ci-lint-go@main + uses: smartcontractkit/.github/actions/ci-lint-go@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # ci-lint-go@0.1.0 with: # grafana inputs metrics-job-name: ci-lint @@ -69,7 +69,7 @@ jobs: runs-on: ubuntu-latest steps: - name: ci-lint-misc - uses: smartcontractkit/.github/actions/ci-lint-misc@main + uses: smartcontractkit/.github/actions/ci-lint-misc@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # ci-lint-misc@0.1.0 with: # grafana inputs metrics-job-name: ci-lint-misc @@ -84,7 +84,7 @@ jobs: actions: read steps: - name: ci-test - uses: smartcontractkit/.github/actions/ci-test-go@main + uses: smartcontractkit/.github/actions/ci-test-go@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # ci-test-go@0.1.0 with: # grafana inputs metrics-job-name: ci-test @@ -102,77 +102,13 @@ jobs: go-version-file: go.mod go-test-cmd: make test-ci - ci-build-artifacts-matrix: - needs: [init] - runs-on: ubuntu20.04-16cores-64GB - strategy: - fail-fast: false - matrix: - package: ${{ fromJson(needs.init.outputs.matrix_packages) }} - permissions: - id-token: write - contents: read - actions: read - steps: - - name: ci-build-artifacts-matrix (${{ matrix.package }}) - uses: smartcontractkit/.github/actions/cicd-build-publish-artifacts-go@main - with: - # general inputs - app-name: chainlink-feeds-${{ matrix.package }} - publish: "true" - # grafana inputs - metrics-job-name: ci-build-artifacts-matrix (${{ matrix.package }}) - gc-basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} - gc-host: ${{ secrets.GRAFANA_CLOUD_HOST }} - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} - aws-account-number: ${{ secrets.AWS_ACCOUNT_NUMBER_PROD }} - # golang inputs - go-version-file: go.mod - # goreleaser inputs - goreleaser-args: "--nightly --config ./.goreleaser.ci.yaml" - goreleaser-dist: goreleaser-pro - goreleaser-key: ${{ secrets.GORELEASER_KEY }} - # zig inputs - use-zig: "true" - zig-version: "0.11.0" - # docker inputs - docker-registry: aws - docker-image-tag: devel - - name: Save GoReleaser artifacts/metadata - uses: actions/upload-artifact@v3 - with: - name: goreleaser_${{ matrix.package }} - path: | - dist/artifacts.json - dist/metadata.json - - ci-build-artifacts: - runs-on: ubuntu-latest - needs: [ci-build-artifacts-matrix] - if: always() - steps: - - name: Check results - if: needs.ci-build-artifacts-matrix.result != 'success' - run: exit 1 - - name: Collect metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2 - with: - basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} - this-job-name: ci-build-artifacts - continue-on-error: true - ci-sonarqube: needs: [ci-lint, ci-test] if: ${{ always() }} runs-on: ubuntu-latest steps: - name: ci-sonarqube - uses: smartcontractkit/.github/actions/ci-sonarqube@main + uses: smartcontractkit/.github/actions/ci-sonarqube@cc4cbbd6d39a8e84915b356379a4ef6a16dceaf9 # ci-sonarqube@0.2.0 with: # grafana inputs metrics-job-name: ci-sonarqube @@ -180,4 +116,4 @@ jobs: gc-host: ${{ secrets.GRAFANA_CLOUD_HOST }} # sonarqube inputs sonar-token: ${{ secrets.SONAR_TOKEN }} - sonar-host-url: ${{ secrets.SONAR_HOST_URL }} \ No newline at end of file + sonar-host-url: ${{ secrets.SONAR_HOST_URL }} diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index 4647520..21dcca8 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -41,7 +41,7 @@ jobs: actions: read steps: - name: ci-lint - uses: smartcontractkit/.github/actions/ci-lint-go@main + uses: smartcontractkit/.github/actions/ci-lint-go@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # ci-lint-go@0.1.0 with: # grafana inputs metrics-job-name: ci-lint @@ -65,7 +65,7 @@ jobs: actions: read steps: - name: ci-test - uses: smartcontractkit/.github/actions/ci-test-go@main + uses: smartcontractkit/.github/actions/ci-test-go@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # ci-test-go@0.1.0 with: # grafana inputs metrics-job-name: ci-test @@ -83,81 +83,13 @@ jobs: go-version-file: go.mod go-test-cmd: make test-ci - cicd-build-publish-artifacts-dev-matrix: - needs: [init] - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - package: ${{ fromJson(needs.init.outputs.matrix_packages) }} - permissions: - id-token: write - contents: write - actions: read - steps: - - name: cicd-build-publish-artifacts-dev-matrix (${{ matrix.package }}) - uses: smartcontractkit/.github/actions/cicd-build-publish-artifacts-go@main - with: - # general inputs - app-name: chainlink-feeds-${{ matrix.package }} - publish: "true" - # grafana inputs - metrics-job-name: cicd-build-publish-artifacts-dev-matrix (${{ matrix.package }}) - gc-basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} - gc-host: ${{ secrets.GRAFANA_CLOUD_HOST }} - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }} - aws-account-number: ${{ secrets.AWS_ACCOUNT_NUMBER_PROD }} - # gati inputs - use-gati: "true" - aws-role-arn-gati: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN_GATI }} - aws-lambda-url-gati: ${{ secrets.AWS_LAMBDA_URL_GATI }} - # golang inputs - go-version-file: go.mod - # goreleaser inputs - goreleaser-args: "--nightly --config ./.goreleaser.ci.yaml" - goreleaser-dist: goreleaser-pro - goreleaser-key: ${{ secrets.GORELEASER_KEY }} - # zig inputs - use-zig: "true" - zig-version: "0.11.0" - # docker inputs - docker-registry: aws - docker-image-tag: devel - - name: Save GoReleaser artifacts/metadata - uses: actions/upload-artifact@v3 - with: - name: goreleaser_${{ matrix.package }} - path: | - dist/artifacts.json - dist/metadata.json - - cicd-build-publish-artifacts-dev: - runs-on: ubuntu-latest - needs: [cicd-build-publish-artifacts-dev-matrix] - if: always() - steps: - - name: Check results - if: needs.cicd-build-publish-artifacts-dev-matrix.result != 'success' - run: exit 1 - - name: Collect metrics - if: always() - id: collect-gha-metrics - uses: smartcontractkit/push-gha-metrics-action@d1618b772a97fd87e6505de97b872ee0b1f1729a # v2.0.2 - with: - basic-auth: ${{ secrets.GRAFANA_CLOUD_BASIC_AUTH }} - hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} - this-job-name: cicd-build-publish-artifacts-dev - continue-on-error: true - ci-sonarqube: needs: [ci-lint, ci-test] if: ${{ always() }} runs-on: ubuntu-latest steps: - name: ci-sonarqube - uses: smartcontractkit/.github/actions/ci-sonarqube@main + uses: smartcontractkit/.github/actions/ci-sonarqube@cc4cbbd6d39a8e84915b356379a4ef6a16dceaf9 # ci-sonarqube@0.2.0 with: # grafana inputs metrics-job-name: ci-sonarqube