From 442f8a0f4f6a25b82ed4c198c6c9fe57e172c7a7 Mon Sep 17 00:00:00 2001 From: Zoran Regvart Date: Mon, 11 Sep 2023 15:53:52 +0200 Subject: [PATCH] Test --- .github/workflows/checks.yaml | 88 +------------------------ .github/workflows/release.yaml | 115 +++------------------------------ 2 files changed, 11 insertions(+), 192 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 99fcc4761..52ce3a914 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -34,47 +34,7 @@ jobs: Test: runs-on: ubuntu-latest steps: - - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 - with: - egress-policy: audit - disable-telemetry: true - - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Restore Cache - uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - key: main - path: '**' - - - name: Setup Go environment - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 - with: - go-version-file: go.mod - cache: false - - - name: Test - run: make test - - - name: Upload unit test coverage report - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - with: - files: ./coverage-unit.out - flags: unit - - - name: Upload generative test coverage report - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - with: - files: ./coverage-generative.out - flags: generative - - - name: Upload integration test coverage report - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - with: - files: ./coverage-integration.out - flags: integration + - run: echo test Acceptance: runs-on: ubuntu-latest @@ -87,51 +47,9 @@ jobs: # egress-policy: audit # disable-telemetry: true - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Restore Cache - uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - key: main - path: '**' - - - name: Setup Go environment - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 - with: - go-version-file: go.mod - cache: false - - - name: Acceptance test - run: make acceptance - - - name: Upload coverage report - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 - with: - files: ./coverage-acceptance.out - flags: acceptance + - run: echo acceptance Tools: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Restore Cache - uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - key: main - path: '**' - - - name: Setup Go environment - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 - with: - go-version-file: go.mod - cache: false - - - name: Development tools can be run - run: | - go run -modfile tools/go.mod github.com/tektoncd/cli/cmd/tkn version - go run -modfile tools/go.mod sigs.k8s.io/kustomize/kustomize/v5 version - go run -modfile tools/go.mod helm.sh/helm/v3/cmd/helm version - go run -modfile tools/go.mod github.com/open-policy-agent/conftest --version + - run: echo tools diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d412db9ae..08ade7790 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,7 +41,13 @@ jobs: GH_TOKEN: ${{ github.token }} GH_COBRA: 1 run: | - echo head_sha=$(gh api /repos/enterprise-contract/ec-cli/git/matching-refs/heads/main --jq '.[0].object.sha') >> "$GITHUB_OUTPUT" + echo head_sha=$(gh api /repos/zregvart/ec-cli/git/matching-refs/heads/main --jq '.[0].object.sha') >> "$GITHUB_OUTPUT" + + wat: + needs: info + runs-on: ubuntu-latest + steps: + - run: echo ${{needs.info.outputs.head_sha}} release: @@ -67,109 +73,4 @@ jobs: # egress-policy: audit # disable-telemetry: true - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - - - name: Cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - .npm - key: main - - - name: Setup Go environment - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 - with: - go-version-file: go.mod - cache: false - - - name: Download go dependencies - run: | - go mod download - (cd tools && go mod download) - (cd acceptance && go mod download) - (cd application && go mod download) - - - name: Setup Node.js environment - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 - with: - node-version-file: 'package.json' - - - name: Download NPM dependencies - run: npm ci - - - name: Build distribution - run: make dist - - # TODO: Remove this once all references to quay.io/hacbs-contract are removed - - name: Registry login - run: podman login -u ${{ secrets.BUNDLE_PUSH_USER }} -p ${{ secrets.BUNDLE_PUSH_PASS }} quay.io - - - name: Set up QEMU - uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0 - - # TODO: Remove this once all references to quay.io/hacbs-contract are removed - - name: Create and push image - run: make dist-image-push IMAGE_TAG=$TAG IMAGE_REPO=$IMAGE_REPO ADD_IMAGE_TAG=snapshot - - # TODO: Remove this once all references to quay.io/hacbs-contract are removed - - name: Create and push the tekton bundle - env: - TASK: "tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml tasks/verify-definition/0.1/verify-definition.yaml" - run: make task-bundle-snapshot TASK_REPO=quay.io/hacbs-contract/ec-task-bundle TASK_TAG=$TAG TASK=<( yq e ".spec.steps[].image? = \"$EC_IMAGE_REPO:$TAG\"" $TASK | yq 'select(. != null)') - - - name: Registry login (quay.io/enterprise-contract) - run: podman login -u ${{ secrets.BUNDLE_PUSH_USER_EC }} -p ${{ secrets.BUNDLE_PUSH_PASS_EC }} quay.io - - - name: Create and push image (quay.io/enterprise-contract/ec-cli) - run: make dist-image-push IMAGE_TAG=$TAG IMAGE_REPO=$EC_IMAGE_REPO ADD_IMAGE_TAG=snapshot - - - name: Create and push the tekton bundle (quay.io/enterprise-contract/ec-task-bundle) - env: - TASK_REPO: quay.io/enterprise-contract/ec-task-bundle - TASK: "tasks/verify-enterprise-contract/0.1/verify-enterprise-contract.yaml tasks/verify-definition/0.1/verify-definition.yaml" - run: make task-bundle-snapshot TASK_REPO=$TASK_REPO TASK_TAG=$TAG TASK=<( yq e ".spec.steps[].image? = \"$EC_IMAGE_REPO:$TAG\"" $TASK | yq 'select(. != null)') - - - name: Download statistics - env: - GH_TOKEN: ${{ github.token }} - run: hack/stats.sh - - - name: Configure statistics pages - uses: actions/configure-pages@f156874f8191504dae5b037505266ed5dda6c382 # v3.0.6 - - - name: Upload statistics - uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c # v2.0.0 - with: - path: stats - - - name: Deploy statistics - uses: actions/deploy-pages@9dbe3824824f8a1377b8e298bafde1a50ede43e5 # v2.0.4 - - - name: Delete snapshot release and tag - run: | - echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token - RELEASE_ID=$(gh api \ - -H 'Accept: application/vnd.github.v3+json' \ - /repos/${{ github.repository }}/releases \ - -q '.[] | select(.tag_name == "snapshot") | .id') - [[ -n "${RELEASE_ID}" ]] && gh api --method DELETE \ - -H 'Accept: application/vnd.github.v3+json' \ - "/repos/${{ github.repository }}/releases/${RELEASE_ID}" - - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git tag -a -f -m 'Development snapshot' snapshot - git push -f --tags - - - name: Release - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 - with: - prerelease: true - name: Rolling release - body: Stable rolling release. Version can be determined by running `ec version` - tag_name: snapshot - generate_release_notes: false - files: dist/* + - run: echo release