From 95310a5e31e15ca2a5f533589202c7b65e96e154 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 14 Nov 2022 19:07:22 +0000 Subject: [PATCH 1/6] Tweaking workflows --- .github/workflows/cla.yaml | 26 -- .github/workflows/coder.yaml | 471 +----------------------------- .github/workflows/dependabot.yaml | 13 - .github/workflows/dogfood.yaml | 73 ----- .github/workflows/mlc_config.json | 22 -- .github/workflows/packages.yaml | 51 ---- .github/workflows/release.yaml | 204 ------------- .github/workflows/stale.yaml | 37 --- .github/workflows/typos.toml | 22 -- .github/workflows/welcome.yaml | 18 -- 10 files changed, 5 insertions(+), 932 deletions(-) delete mode 100644 .github/workflows/cla.yaml delete mode 100644 .github/workflows/dependabot.yaml delete mode 100644 .github/workflows/dogfood.yaml delete mode 100644 .github/workflows/mlc_config.json delete mode 100644 .github/workflows/packages.yaml delete mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/stale.yaml delete mode 100644 .github/workflows/typos.toml delete mode 100644 .github/workflows/welcome.yaml diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml deleted file mode 100644 index 81aafca379552..0000000000000 --- a/.github/workflows/cla.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: "CLA Assistant" -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened,closed,synchronize] - -jobs: - CLAssistant: - runs-on: ubuntu-latest - steps: - - name: "CLA Assistant" - if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - uses: contributor-assistant/github-action@v2.2.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # the below token should have repo scope and must be manually added by you in the repository's secret - PERSONAL_ACCESS_TOKEN : ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }} - with: - remote-organization-name: 'coder' - remote-repository-name: 'cla' - path-to-signatures: 'v2022-09-04/signatures.json' - path-to-document: 'https://github.com/coder/cla/blob/main/README.md' - # branch should not be protected - branch: 'main' - allowlist: dependabot* diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index d2bd0bf4a5dfa..6c39d165997ab 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -1,25 +1,9 @@ name: coder on: - push: - branches: - - main - - pull_request: - workflow_dispatch: - -permissions: - actions: none - checks: none - contents: read - deployments: none - issues: none - packages: none - pull-requests: none - repository-projects: none - security-events: none - statuses: none + schedule: + - cron: "*/30 * * * *" # Cancel in-progress runs for pull requests when developers push # additional changes @@ -76,30 +60,6 @@ jobs: run: | echo "${{ toJSON(steps.filter )}}" - # Debug step - debug-inputs: - needs: - - changes - runs-on: ubuntu-latest - steps: - - id: log - run: | - echo "${{ toJSON(needs) }}" - - style-lint-golangci: - name: style/lint/golangci - timeout-minutes: 5 - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: "~1.19" - - name: golangci-lint - uses: golangci/golangci-lint-action@v3.3.0 - with: - version: v1.48.0 - check-enterprise-imports: name: check/enterprise-imports timeout-minutes: 5 @@ -109,65 +69,6 @@ jobs: - name: Check imports of enterprise code run: ./scripts/check_enterprise_imports.sh - style-lint-shellcheck: - name: style/lint/shellcheck - timeout-minutes: 5 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@1.1.0 - env: - SHELLCHECK_OPTS: --external-sources - with: - ignore: node_modules - - style-lint-typescript: - name: "style/lint/typescript" - timeout-minutes: 5 - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Cache Node - id: cache-node - uses: actions/cache@v3 - with: - path: | - **/node_modules - .eslintcache - key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - js-${{ runner.os }}- - - - name: Install node_modules - run: ./scripts/yarn_install.sh - - - name: "yarn lint" - run: yarn lint - working-directory: site - - style-lint-k8s: - name: "style/lint/k8s" - timeout-minutes: 5 - needs: changes - if: needs.changes.outputs.k8s == 'true' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install helm - uses: azure/setup-helm@v3 - with: - version: v3.9.2 - - - name: cd helm && make lint - run: | - cd helm - make lint - gen: name: "style/gen" timeout-minutes: 8 @@ -177,42 +78,14 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Cache Node - id: cache-node - uses: actions/cache@v3 - with: - path: | - **/node_modules - .eslintcache - key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - js-${{ runner.os }}- - - name: Install node_modules run: ./scripts/yarn_install.sh - uses: actions/setup-go@v3 with: + cache: true go-version: "~1.19" - - name: Echo Go Cache Paths - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ github.job }}-go-build-${{ hashFiles('**/go.sum', '**/**.go') }} - - - name: Go Mod Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ github.job }}-go-mod-${{ hashFiles('**/go.sum') }} - - name: Install sqlc run: | curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.13.0/sqlc_1.13.0_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc @@ -241,39 +114,6 @@ jobs: - name: Check for unstaged files run: ./scripts/check_unstaged.sh - style-fmt: - name: "style/fmt" - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: true - - - name: Cache Node - id: cache-node - uses: actions/cache@v3 - with: - path: | - **/node_modules - .eslintcache - key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - js-${{ runner.os }}- - - - name: Install node_modules - run: ./scripts/yarn_install.sh - - - name: Install shfmt - run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0 - - - name: make fmt - run: | - export PATH=${PATH}:$(go env GOPATH)/bin - make --output-sync -j -B fmt - test-go: name: "test/go" runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }} @@ -289,26 +129,9 @@ jobs: - uses: actions/setup-go@v3 with: + cache: true go-version: "~1.19" - - name: Echo Go Cache Paths - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }} - - - name: Go Mod Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - name: Install gotestsum uses: jaxxstorm/action-install-gh-release@v1.7.1 env: @@ -363,26 +186,9 @@ jobs: - uses: actions/setup-go@v3 with: + cache: true go-version: "~1.19" - - name: Echo Go Cache Paths - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum', '**/**.go') }} - - - name: Go Mod Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - name: Install gotestsum uses: jaxxstorm/action-install-gh-release@v1.7.1 env: @@ -410,270 +216,3 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./gotests.coverage flags: unittest-go-postgres-${{ matrix.os }} - - deploy: - name: "deploy" - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - timeout-minutes: 30 - needs: changes - if: | - github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork - && needs.changes.outputs.docs-only == 'false' - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v0 - with: - workload_identity_provider: projects/573722524737/locations/global/workloadIdentityPools/github/providers/github - service_account: coder-ci@coder-dogfood.iam.gserviceaccount.com - - - name: Set up Google Cloud SDK - uses: google-github-actions/setup-gcloud@v0 - - - uses: actions/setup-go@v3 - with: - go-version: "~1.19" - - - name: Echo Go Cache Paths - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-release-go-build-${{ hashFiles('**/go.sum') }} - - - name: Go Mod Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-release-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Cache Node - id: cache-node - uses: actions/cache@v3 - with: - path: | - **/node_modules - .eslintcache - key: js-${{ runner.os }}-release-node-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - js-${{ runner.os }}- - - - name: Install goimports - run: go install golang.org/x/tools/cmd/goimports@latest - - name: Install nfpm - run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.16.0 - - - name: Install zstd - run: sudo apt-get install -y zstd - - - name: Build Release - run: | - set -euo pipefail - go mod download - - version="$(./scripts/version.sh)" - make gen/mark-fresh - make -j \ - build/coder_"$version"_windows_amd64.zip \ - build/coder_"$version"_linux_amd64.{tar.gz,deb} - - - name: Install Release - run: | - gcloud config set project coder-dogfood - gcloud config set compute/zone us-central1-a - gcloud compute scp ./build/coder_*_linux_amd64.deb coder:/tmp/coder.deb - gcloud compute ssh coder -- sudo dpkg -i --force-confdef /tmp/coder.deb - gcloud compute ssh coder -- sudo systemctl daemon-reload - - - name: Start - run: gcloud compute ssh coder -- sudo service coder restart - - - uses: actions/upload-artifact@v3 - with: - name: coder - path: | - ./build/*.zip - ./build/*.tar.gz - ./build/*.deb - retention-days: 7 - - test-js: - name: "test/js" - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - timeout-minutes: 20 - steps: - - uses: actions/checkout@v3 - - - name: Cache Node - id: cache-node - uses: actions/cache@v3 - with: - path: | - **/node_modules - .eslintcache - key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - js-${{ runner.os }}- - - - uses: actions/setup-node@v3 - with: - node-version: "14" - - - name: Install node_modules - run: ./scripts/yarn_install.sh - - - run: yarn test:coverage - working-directory: site - - - uses: codecov/codecov-action@v3 - # This action has a tendency to error out unexpectedly, it has - # the `fail_ci_if_error` option that defaults to `false`, but - # that is no guarantee, see: - # https://github.com/codecov/codecov-action/issues/788 - continue-on-error: true - if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./site/coverage/lcov.info - flags: unittest-js - - test-e2e: - name: "test/e2e/${{ matrix.os }}" - needs: - - changes - if: needs.changes.outputs.docs-only == 'false' - runs-on: ${{ matrix.os }} - timeout-minutes: 20 - strategy: - matrix: - os: - - ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Cache Node - id: cache-node - uses: actions/cache@v3 - with: - path: | - **/node_modules - .eslintcache - key: js-${{ runner.os }}-e2e-${{ hashFiles('**/yarn.lock') }} - - - uses: actions/setup-go@v3 - with: - go-version: "~1.19" - - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.1.9 - terraform_wrapper: false - - - uses: actions/setup-node@v3 - with: - node-version: "14" - - - name: Echo Go Cache Paths - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Go Build Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - - name: Go Mod Cache - uses: actions/cache@v3 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Build - run: | - sudo npm install -g prettier - make -B site/out/index.html - - - run: yarn playwright:install - working-directory: site - - - run: yarn playwright:install-deps - working-directory: site - - - run: yarn playwright:test - env: - DEBUG: pw:api - working-directory: site - - - name: Upload Playwright Failed Tests - if: always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork - uses: actions/upload-artifact@v3 - with: - name: failed-test-videos - path: ./site/test-results/**/*.webm - retention-days: 7 - - chromatic: - # REMARK: this is only used to build storybook and deploy it to Chromatic. - runs-on: ubuntu-latest - needs: - - changes - if: needs.changes.outputs.ts == 'true' - steps: - - uses: actions/checkout@v3 - with: - # Required by Chromatic for build-over-build history, otherwise we - # only get 1 commit on shallow checkout. - fetch-depth: 0 - - - name: Install dependencies - run: cd site && yarn - - # This step is not meant for mainline because any detected changes to - # storybook snapshots will require manual approval/review in order for - # the check to pass. This is desired in PRs, but not in mainline. - - name: Publish to Chromatic (non-mainline) - if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder' - uses: chromaui/action@v1 - with: - buildScriptName: "storybook:build" - exitOnceUploaded: true - # Chromatic states its fine to make this token public. See: - # https://www.chromatic.com/docs/github-actions#forked-repositories - projectToken: 695c25b6cb65 - workingDir: "./site" - - # This is a separate step for mainline only that auto accepts and changes - # instead of holding CI up. Since we squash/merge, this is defensive to - # avoid the same changeset from requiring review once squashed into - # main. Chromatic is supposed to be able to detect that we use squash - # commits, but it's good to be defensive in case, otherwise CI remains - # infinitely "in progress" in mainline unless we re-review each build. - - name: Publish to Chromatic (mainline) - if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder' - uses: chromaui/action@v1 - with: - autoAcceptChanges: true - buildScriptName: "storybook:build" - projectToken: 695c25b6cb65 - workingDir: "./site" - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - config-file: .github/workflows/mlc_config.json diff --git a/.github/workflows/dependabot.yaml b/.github/workflows/dependabot.yaml deleted file mode 100644 index 0a41a54b70688..0000000000000 --- a/.github/workflows/dependabot.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Dependabot is annoying, but this makes it a bit less so. -name: Auto Approve Dependabot - -on: pull_request_target - -jobs: - auto-approve: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - uses: hmarr/auto-approve-action@v2 - if: github.actor == 'dependabot[bot]' diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml deleted file mode 100644 index a070b0061ef51..0000000000000 --- a/.github/workflows/dogfood.yaml +++ /dev/null @@ -1,73 +0,0 @@ -name: dogfood - -on: - push: - branches: - - main - paths: - - "dogfood/**" - pull_request: - paths: - - "dogfood/**" - workflow_dispatch: - -jobs: - deploy_image: - runs-on: ubuntu-latest - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6.2 - - - name: "Branch name to Docker tag name" - id: docker-tag-name - run: | - tag=${{ steps.branch-name.outputs.current_branch }} - # Replace / with --, e.g. user/feature => user--feature. - tag=${tag//\//--} - echo "::set-output name=tag::${tag}" - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: "{{defaultContext}}:dogfood" - push: true - tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest" - cache-from: type=registry,ref=codercom/oss-dogfood:latest - cache-to: type=inline - deploy_template: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Get short commit SHA - id: vars - run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: "Install latest Coder" - run: | - curl -L https://coder.com/install.sh | sh - # env: - # VERSION: 0.x - - name: "Push template" - run: | - coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION - env: - # Consumed by Coder CLI - CODER_URL: https://dev.coder.com - CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }} - # Template source & details - CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }} - CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }} - CODER_TEMPLATE_DIR: ./dogfood diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json deleted file mode 100644 index 2a0fdc7cbfce1..0000000000000 --- a/.github/workflows/mlc_config.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": ":\/\/localhost" - }, - { - "pattern": ":\/\/.*.?example\\.com" - }, - { - "pattern": "developer.github.com" - }, - { - "pattern": "docs.github.com" - }, - { - "pattern": "support.google.com" - }, - { - "pattern": "tailscale.com" - } - ] -} diff --git a/.github/workflows/packages.yaml b/.github/workflows/packages.yaml deleted file mode 100644 index d5e86fea37d2d..0000000000000 --- a/.github/workflows/packages.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Submit Packages -on: - release: - types: [published] - -env: - CODER_VERSION: "${{ github.event.release.tag_name }}" - -jobs: - winget: - runs-on: windows-latest - steps: - - name: Install wingetcreate - run: | - Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - - # the package version is the same as the release tag without the leading - # "v", and with a trailing ".0" (e.g. "v1.2.3" -> "1.2.3.0") - - name: Calculate package version - id: version - run: | - $version = $env:CODER_VERSION -replace "^v", "" - $version += ".0" - echo "::set-output name=version::$version" - - - name: Submit updated manifest to winget-pkgs - run: | - $release_assets = gh release view --repo coder/coder "$env:CODER_VERSION" --json assets | ` - ConvertFrom-Json - - $installer_url = $release_assets.assets | ` - Where-Object name -Match ".*_windows_amd64_installer.exe$" | ` - Select -ExpandProperty url - - echo "Installer URL: $installer_url" - - # version should be extracted from the installer - wingetcreate update Coder.Coder ` - --submit ` - --version "${{ steps.version.outputs.version }}" ` - --urls "$installer_url" ` - --token "${{ secrets.CDRCI_GITHUB_TOKEN }}" - - - name: Comment on PR - run: | - # find the PR that wingetcreate just made - $pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.Coder version ${{ steps.version.outputs.version }}" --limit 1 --json number | ` - ConvertFrom-Json` - $pr_number = $pr_list[0].number - - gh pr comment --repo microsoft/winget-pkgs "$pr_number" --body "🤖 cc: @deansheather" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 8444e30baa030..0000000000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,204 +0,0 @@ -# GitHub release workflow. -name: release -on: - push: - tags: - - "v*" - workflow_dispatch: - inputs: - snapshot: - description: Force a dev version to be generated, implies dry_run. - type: boolean - required: true - dry_run: - description: Perform a dry-run release. - type: boolean - required: true - -permissions: - # Required to publish a release - contents: write - # Necessary to push docker images to ghcr.io. - packages: write - # Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage) - id-token: write - -env: - CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }} - -jobs: - release: - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - env: - # Necessary for Docker manifest - DOCKER_CLI_EXPERIMENTAL: "enabled" - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # If the event that triggered the build was an annotated tag (which our - # tags are supposed to be), actions/checkout has a bug where the tag in - # question is only a lightweight tag and not a full annotated tag. This - # command seems to fix it. - # https://github.com/actions/checkout/issues/290 - - name: Fetch git tags - run: git fetch --tags --force - - - name: Docker Login - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/setup-go@v3 - with: - go-version: "~1.19" - - - name: Cache Node - id: cache-node - uses: actions/cache@v3 - with: - path: | - **/node_modules - .eslintcache - key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - js-${{ runner.os }}- - - - name: Install nsis and zstd - run: sudo apt-get install -y nsis zstd - - - name: Install nfpm - run: | - set -euo pipefail - wget -O /tmp/nfpm.deb https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb - sudo dpkg -i /tmp/nfpm.deb - - - name: Install rcodesign - run: | - set -euo pipefail - - # Install a prebuilt binary of rcodesign for linux amd64. Once the - # following PR is merged and released upstream, we can download - # directly from GitHub releases instead: - # https://github.com/indygreg/PyOxidizer/pull/635 - wget -O /tmp/rcodesign https://cdn.discordapp.com/attachments/283356472258199552/1016767245717872700/rcodesign - sudo install --mode 755 /tmp/rcodesign /usr/local/bin/rcodesign - - - name: Setup Apple Developer certificate and API key - run: | - set -euo pipefail - touch /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8} - chmod 600 /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8} - echo "$AC_CERTIFICATE_P12_BASE64" | base64 -d > /tmp/apple_cert.p12 - echo "$AC_CERTIFICATE_PASSWORD" > /tmp/apple_cert_password.txt - echo "$AC_APIKEY_P8_BASE64" | base64 -d > /tmp/apple_apikey.p8 - env: - AC_CERTIFICATE_P12_BASE64: ${{ secrets.AC_CERTIFICATE_P12_BASE64 }} - AC_CERTIFICATE_PASSWORD: ${{ secrets.AC_CERTIFICATE_PASSWORD }} - AC_APIKEY_P8_BASE64: ${{ secrets.AC_APIKEY_P8_BASE64 }} - - - name: Build binaries - run: | - set -euo pipefail - go mod download - - version="$(./scripts/version.sh)" - make gen/mark-fresh - make -j \ - build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \ - build/coder_"$version"_{darwin,windows}_{amd64,arm64}.zip \ - build/coder_"$version"_windows_amd64_installer.exe \ - build/coder_helm_"$version".tgz - env: - CODER_SIGN_DARWIN: "1" - AC_CERTIFICATE_FILE: /tmp/apple_cert.p12 - AC_CERTIFICATE_PASSWORD_FILE: /tmp/apple_cert_password.txt - AC_APIKEY_ISSUER_ID: ${{ secrets.AC_APIKEY_ISSUER_ID }} - AC_APIKEY_ID: ${{ secrets.AC_APIKEY_ID }} - AC_APIKEY_FILE: /tmp/apple_apikey.p8 - - - name: Delete Apple Developer certificate and API key - run: rm -f /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8} - - - name: Build Linux Docker images - run: | - set -euxo pipefail - - # build Docker images for each architecture - version="$(./scripts/version.sh)" - make -j build/coder_"$version"_linux_{amd64,arm64,armv7}.tag - - # we can't build multi-arch if the images aren't pushed, so quit now - # if dry-running - if [[ "$CODER_RELEASE" != *t* ]]; then - echo Skipping multi-arch docker builds due to dry-run. - exit 0 - fi - - # build and push multi-arch manifest, this depends on the other images - # being pushed so will automatically push them. - make -j push/build/coder_"$version"_linux.tag - - # if the current version is equal to the highest (according to semver) - # version in the repo, also create a multi-arch image as ":latest" and - # push it - if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then - ./scripts/build_docker_multiarch.sh \ - --push \ - --target "$(./scripts/image_tag.sh --version latest)" \ - $(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag) - fi - - - name: ls build - run: ls -lh build - - - name: Publish release - run: | - ./scripts/publish_release.sh \ - ${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && '--dry-run' }} \ - ./build/*_installer.exe \ - ./build/*.zip \ - ./build/*.tar.gz \ - ./build/*.tgz \ - ./build/*.apk \ - ./build/*.deb \ - ./build/*.rpm - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v0 - with: - workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }} - service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} - - - name: Setup GCloud SDK - uses: 'google-github-actions/setup-gcloud@v0' - - - name: Publish Helm Chart - run: | - set -euo pipefail - version="$(./scripts/version.sh)" - mkdir -p build/helm - cp "build/coder_helm_${version}.tgz" build/helm - gsutil cp gs://helm.coder.com/v2/index.yaml build/helm/index.yaml - helm repo index build/helm --url https://helm.coder.com/v2 --merge build/helm/index.yaml - gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/coder_helm_${version}.tgz gs://helm.coder.com/v2 - gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/v2 - - - name: Upload artifacts to actions (if dry-run or snapshot) - if: ${{ github.event.inputs.dry_run || github.event.inputs.snapshot }} - uses: actions/upload-artifact@v2 - with: - name: release-artifacts - path: | - ./build/*.zip - ./build/*.tar.gz - ./build/*.tgz - ./build/*.apk - ./build/*.deb - ./build/*.rpm - retention-days: 7 diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml deleted file mode 100644 index f2d49ab5d337e..0000000000000 --- a/.github/workflows/stale.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Stale Issue Cron -on: - schedule: - # Every day at midnight - - cron: "0 0 * * *" - workflow_dispatch: -jobs: - stale: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - # v5.1.0 has a weird bug that makes stalebot add then remove its own label - # https://github.com/actions/stale/pull/775 - - uses: actions/stale@v6.0.0 - with: - stale-issue-label: 'stale' - stale-pr-label: 'stale' - exempt-issue-labels: 'never stale' - exempt-pr-labels: 'never stale' - # Pull Requests become stale more quickly due to merge conflicts. - # Also, we promote minimizing WIP. - days-before-pr-stale: 7 - days-before-pr-close: 3 - stale-pr-message: > - This Pull Request is becoming stale. In order to minimize WIP, - prevent merge conflicts and keep the tracker readable, I'm going - close to this PR in 3 days if there isn't more activity. - stale-issue-message: > - This issue is becoming stale. In order to keep the tracker readable - and actionable, I'm going close to this issue in 7 days if there - isn't more activity. - # Upped from 30 since we have a big tracker and was hitting the limit. - operations-per-run: 60 - # Start with the oldest issues, always. - ascending: true diff --git a/.github/workflows/typos.toml b/.github/workflows/typos.toml deleted file mode 100644 index 455392eb13754..0000000000000 --- a/.github/workflows/typos.toml +++ /dev/null @@ -1,22 +0,0 @@ -[default.extend-identifiers] -alog = "alog" -Jetbrains = "JetBrains" -IST = "IST" -MacOS = "macOS" - -[default.extend-words] -# do as sudo replacement -doas = "doas" -darcula = "darcula" - -[files] -extend-exclude = [ - "**.svg", - "**.png", - "**.lock", - "go.sum", - "go.mod", - # These files contain base64 strings that confuse the detector - "**XService**.ts", - "**identity.go", -] diff --git a/.github/workflows/welcome.yaml b/.github/workflows/welcome.yaml deleted file mode 100644 index 93973880fedf1..0000000000000 --- a/.github/workflows/welcome.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: Welcome -on: - pull_request: - types: [opened] -jobs: - test: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - uses: wow-actions/welcome@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FIRST_PR_REACTIONS: '+1, hooray, rocket, heart' - FIRST_PR_COMMENT: | - 👋 Welcome @{{ author }} to Coder! Yo @coder/docs this is @{{ author }}'s first pull-request here! - FIRST_PR_MERGED: | - 🎉 Thanks for the contribution @{{ author }}! Yo @coder/docs @{{ author }}'s first contribution has been merged! 👀👀👀 From e3e8130256278135539c061ddddb226bb3c73517 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 14 Nov 2022 19:09:19 +0000 Subject: [PATCH 2/6] Remove job --- .github/workflows/coder.yaml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 6c39d165997ab..fe8dcc6986f6d 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -12,22 +12,6 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - typos: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: typos-action - uses: crate-ci/typos@v1.12.12 - with: - config: .github/workflows/typos.toml - - name: Fix Helper - if: ${{ failure() }} - run: | - echo "::notice:: you can automatically fix typos from your CLI: - cargo install typos-cli - typos -c .github/workflows/typos.toml -w" - changes: runs-on: ubuntu-latest outputs: From 77f82c124b61ad1d24fd2efcac533319ea705bfc Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 14 Nov 2022 20:22:28 +0000 Subject: [PATCH 3/6] Cache and nocache versions --- .../{coder.yaml => coder_cache.yaml} | 2 +- .github/workflows/coder_nocache.yaml | 199 ++++++++++++++++++ 2 files changed, 200 insertions(+), 1 deletion(-) rename .github/workflows/{coder.yaml => coder_cache.yaml} (99%) create mode 100644 .github/workflows/coder_nocache.yaml diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder_cache.yaml similarity index 99% rename from .github/workflows/coder.yaml rename to .github/workflows/coder_cache.yaml index fe8dcc6986f6d..43c99ddc401f4 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder_cache.yaml @@ -1,4 +1,4 @@ -name: coder +name: Coder Cache on: workflow_dispatch: diff --git a/.github/workflows/coder_nocache.yaml b/.github/workflows/coder_nocache.yaml new file mode 100644 index 0000000000000..a205bc61fd59a --- /dev/null +++ b/.github/workflows/coder_nocache.yaml @@ -0,0 +1,199 @@ +name: Coder No Cache + +on: + workflow_dispatch: + schedule: + - cron: "*/30 * * * *" + +# Cancel in-progress runs for pull requests when developers push +# additional changes +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }} + sh: ${{ steps.filter.outputs.sh }} + ts: ${{ steps.filter.outputs.ts }} + k8s: ${{ steps.filter.outputs.k8s }} + steps: + - uses: actions/checkout@v3 + # For pull requests it's not necessary to checkout the code + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + all: + - '**' + docs: + - 'docs/**' + # For testing: + # - '.github/**' + sh: + - "**.sh" + ts: + - 'site/**' + k8s: + - 'helm/**' + - Dockerfile + - scripts/helm.sh + - id: debug + run: | + echo "${{ toJSON(steps.filter )}}" + + check-enterprise-imports: + name: check/enterprise-imports + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check imports of enterprise code + run: ./scripts/check_enterprise_imports.sh + + gen: + name: "style/gen" + timeout-minutes: 8 + runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} + needs: changes + if: needs.changes.outputs.docs-only == 'false' + steps: + - uses: actions/checkout@v3 + + - name: Install node_modules + run: ./scripts/yarn_install.sh + + - uses: actions/setup-go@v3 + with: + go-version: "~1.19" + + - name: Install sqlc + run: | + curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.13.0/sqlc_1.13.0_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc + - name: Install protoc-gen-go + run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 + - name: Install protoc-gen-go-drpc + run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 + - name: Install goimports + run: go install golang.org/x/tools/cmd/goimports@latest + + - name: Install Protoc + run: | + # protoc must be in lockstep with our dogfood Dockerfile + # or the version in the comments will differ. + set -x + cd dogfood + DOCKER_BUILDKIT=1 docker build . --target proto -t protoc + protoc_path=/usr/local/bin/protoc + docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path + chmod +x $protoc_path + protoc --version + + - name: make gen + run: "make --output-sync -j -B gen" + + - name: Check for unstaged files + run: ./scripts/check_unstaged.sh + + test-go: + name: "test/go" + runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }} + timeout-minutes: 20 + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-2022 + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version: "~1.19" + + - name: Install gotestsum + uses: jaxxstorm/action-install-gh-release@v1.7.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + repo: gotestyourself/gotestsum + tag: v1.8.2 + + - uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.1.9 + terraform_wrapper: false + + - name: Test with Mock Database + id: test + shell: bash + run: | + # Code coverage is more computationally expensive and also + # prevents test caching, so we disable it on alternate operating + # systems. + if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then + echo ::set-output name=cover::true + export COVERAGE_FLAGS='-covermode=atomic -coverprofile="gotests.coverage" -coverpkg=./...' + else + echo ::set-output name=cover::false + fi + set -x + gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS + + - uses: codecov/codecov-action@v3 + # This action has a tendency to error out unexpectedly, it has + # the `fail_ci_if_error` option that defaults to `false`, but + # that is no guarantee, see: + # https://github.com/codecov/codecov-action/issues/788 + continue-on-error: true + if: steps.test.outputs.cover && github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./gotests.coverage + flags: unittest-go-${{ matrix.os }} + + test-go-postgres: + name: "test/go/postgres" + runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} + # This timeout must be greater than the timeout set by `go test` in + # `make test-postgres` to ensure we receive a trace of running + # goroutines. Setting this to the timeout +5m should work quite well + # even if some of the preceding steps are slow. + timeout-minutes: 25 + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v3 + with: + go-version: "~1.19" + + - name: Install gotestsum + uses: jaxxstorm/action-install-gh-release@v1.7.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + repo: gotestyourself/gotestsum + tag: v1.8.2 + + - uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.1.9 + terraform_wrapper: false + + - name: Test with PostgreSQL Database + run: make test-postgres + + - uses: codecov/codecov-action@v3 + # This action has a tendency to error out unexpectedly, it has + # the `fail_ci_if_error` option that defaults to `false`, but + # that is no guarantee, see: + # https://github.com/codecov/codecov-action/issues/788 + continue-on-error: true + if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./gotests.coverage + flags: unittest-go-postgres-${{ matrix.os }} From ab52ab0eb3b7facd8db8166bfb679f7e0346a385 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 18 Nov 2022 15:19:00 +0000 Subject: [PATCH 4/6] Removing some noisy jobs --- .github/workflows/coder_cache.yaml | 53 ---------------------------- .github/workflows/coder_nocache.yaml | 52 --------------------------- 2 files changed, 105 deletions(-) diff --git a/.github/workflows/coder_cache.yaml b/.github/workflows/coder_cache.yaml index 43c99ddc401f4..8663aa9320859 100644 --- a/.github/workflows/coder_cache.yaml +++ b/.github/workflows/coder_cache.yaml @@ -44,15 +44,6 @@ jobs: run: | echo "${{ toJSON(steps.filter )}}" - check-enterprise-imports: - name: check/enterprise-imports - timeout-minutes: 5 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Check imports of enterprise code - run: ./scripts/check_enterprise_imports.sh - gen: name: "style/gen" timeout-minutes: 8 @@ -156,47 +147,3 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./gotests.coverage flags: unittest-go-${{ matrix.os }} - - test-go-postgres: - name: "test/go/postgres" - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - # This timeout must be greater than the timeout set by `go test` in - # `make test-postgres` to ensure we receive a trace of running - # goroutines. Setting this to the timeout +5m should work quite well - # even if some of the preceding steps are slow. - timeout-minutes: 25 - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-go@v3 - with: - cache: true - go-version: "~1.19" - - - name: Install gotestsum - uses: jaxxstorm/action-install-gh-release@v1.7.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - repo: gotestyourself/gotestsum - tag: v1.8.2 - - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.1.9 - terraform_wrapper: false - - - name: Test with PostgreSQL Database - run: make test-postgres - - - uses: codecov/codecov-action@v3 - # This action has a tendency to error out unexpectedly, it has - # the `fail_ci_if_error` option that defaults to `false`, but - # that is no guarantee, see: - # https://github.com/codecov/codecov-action/issues/788 - continue-on-error: true - if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./gotests.coverage - flags: unittest-go-postgres-${{ matrix.os }} diff --git a/.github/workflows/coder_nocache.yaml b/.github/workflows/coder_nocache.yaml index a205bc61fd59a..18f70780c838c 100644 --- a/.github/workflows/coder_nocache.yaml +++ b/.github/workflows/coder_nocache.yaml @@ -44,15 +44,6 @@ jobs: run: | echo "${{ toJSON(steps.filter )}}" - check-enterprise-imports: - name: check/enterprise-imports - timeout-minutes: 5 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Check imports of enterprise code - run: ./scripts/check_enterprise_imports.sh - gen: name: "style/gen" timeout-minutes: 8 @@ -154,46 +145,3 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: ./gotests.coverage flags: unittest-go-${{ matrix.os }} - - test-go-postgres: - name: "test/go/postgres" - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - # This timeout must be greater than the timeout set by `go test` in - # `make test-postgres` to ensure we receive a trace of running - # goroutines. Setting this to the timeout +5m should work quite well - # even if some of the preceding steps are slow. - timeout-minutes: 25 - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-go@v3 - with: - go-version: "~1.19" - - - name: Install gotestsum - uses: jaxxstorm/action-install-gh-release@v1.7.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - repo: gotestyourself/gotestsum - tag: v1.8.2 - - - uses: hashicorp/setup-terraform@v2 - with: - terraform_version: 1.1.9 - terraform_wrapper: false - - - name: Test with PostgreSQL Database - run: make test-postgres - - - uses: codecov/codecov-action@v3 - # This action has a tendency to error out unexpectedly, it has - # the `fail_ci_if_error` option that defaults to `false`, but - # that is no guarantee, see: - # https://github.com/codecov/codecov-action/issues/788 - continue-on-error: true - if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./gotests.coverage - flags: unittest-go-postgres-${{ matrix.os }} From d54ac84b1b24120f1cc394dc834952d601f61dfc Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Fri, 18 Nov 2022 16:28:54 +0000 Subject: [PATCH 5/6] Getting rid of all other jobs --- .github/workflows/coder_cache.yaml | 77 ---------------------------- .github/workflows/coder_nocache.yaml | 76 --------------------------- 2 files changed, 153 deletions(-) diff --git a/.github/workflows/coder_cache.yaml b/.github/workflows/coder_cache.yaml index 8663aa9320859..55691b1705788 100644 --- a/.github/workflows/coder_cache.yaml +++ b/.github/workflows/coder_cache.yaml @@ -12,83 +12,6 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - changes: - runs-on: ubuntu-latest - outputs: - docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }} - sh: ${{ steps.filter.outputs.sh }} - ts: ${{ steps.filter.outputs.ts }} - k8s: ${{ steps.filter.outputs.k8s }} - steps: - - uses: actions/checkout@v3 - # For pull requests it's not necessary to checkout the code - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - all: - - '**' - docs: - - 'docs/**' - # For testing: - # - '.github/**' - sh: - - "**.sh" - ts: - - 'site/**' - k8s: - - 'helm/**' - - Dockerfile - - scripts/helm.sh - - id: debug - run: | - echo "${{ toJSON(steps.filter )}}" - - gen: - name: "style/gen" - timeout-minutes: 8 - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - needs: changes - if: needs.changes.outputs.docs-only == 'false' - steps: - - uses: actions/checkout@v3 - - - name: Install node_modules - run: ./scripts/yarn_install.sh - - - uses: actions/setup-go@v3 - with: - cache: true - go-version: "~1.19" - - - name: Install sqlc - run: | - curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.13.0/sqlc_1.13.0_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc - - name: Install protoc-gen-go - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 - - name: Install protoc-gen-go-drpc - run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 - - name: Install goimports - run: go install golang.org/x/tools/cmd/goimports@latest - - - name: Install Protoc - run: | - # protoc must be in lockstep with our dogfood Dockerfile - # or the version in the comments will differ. - set -x - cd dogfood - DOCKER_BUILDKIT=1 docker build . --target proto -t protoc - protoc_path=/usr/local/bin/protoc - docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path - chmod +x $protoc_path - protoc --version - - - name: make gen - run: "make --output-sync -j -B gen" - - - name: Check for unstaged files - run: ./scripts/check_unstaged.sh - test-go: name: "test/go" runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }} diff --git a/.github/workflows/coder_nocache.yaml b/.github/workflows/coder_nocache.yaml index 18f70780c838c..20ccc91dc1c57 100644 --- a/.github/workflows/coder_nocache.yaml +++ b/.github/workflows/coder_nocache.yaml @@ -12,82 +12,6 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - changes: - runs-on: ubuntu-latest - outputs: - docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }} - sh: ${{ steps.filter.outputs.sh }} - ts: ${{ steps.filter.outputs.ts }} - k8s: ${{ steps.filter.outputs.k8s }} - steps: - - uses: actions/checkout@v3 - # For pull requests it's not necessary to checkout the code - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - all: - - '**' - docs: - - 'docs/**' - # For testing: - # - '.github/**' - sh: - - "**.sh" - ts: - - 'site/**' - k8s: - - 'helm/**' - - Dockerfile - - scripts/helm.sh - - id: debug - run: | - echo "${{ toJSON(steps.filter )}}" - - gen: - name: "style/gen" - timeout-minutes: 8 - runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }} - needs: changes - if: needs.changes.outputs.docs-only == 'false' - steps: - - uses: actions/checkout@v3 - - - name: Install node_modules - run: ./scripts/yarn_install.sh - - - uses: actions/setup-go@v3 - with: - go-version: "~1.19" - - - name: Install sqlc - run: | - curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.13.0/sqlc_1.13.0_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc - - name: Install protoc-gen-go - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 - - name: Install protoc-gen-go-drpc - run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 - - name: Install goimports - run: go install golang.org/x/tools/cmd/goimports@latest - - - name: Install Protoc - run: | - # protoc must be in lockstep with our dogfood Dockerfile - # or the version in the comments will differ. - set -x - cd dogfood - DOCKER_BUILDKIT=1 docker build . --target proto -t protoc - protoc_path=/usr/local/bin/protoc - docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path - chmod +x $protoc_path - protoc --version - - - name: make gen - run: "make --output-sync -j -B gen" - - - name: Check for unstaged files - run: ./scripts/check_unstaged.sh - test-go: name: "test/go" runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }} From 813dafc23cb5f7bc2bd6918bd9e7d1b3076c15ee Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 5 Dec 2022 05:43:21 +0000 Subject: [PATCH 6/6] Changes --- .github/workflows/coder_cache.yaml | 4 ++-- .github/workflows/coder_nocache.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coder_cache.yaml b/.github/workflows/coder_cache.yaml index 55691b1705788..6358e007e29c8 100644 --- a/.github/workflows/coder_cache.yaml +++ b/.github/workflows/coder_cache.yaml @@ -2,8 +2,8 @@ name: Coder Cache on: workflow_dispatch: - schedule: - - cron: "*/30 * * * *" + # schedule: + # - cron: "*/30 * * * *" # Cancel in-progress runs for pull requests when developers push # additional changes diff --git a/.github/workflows/coder_nocache.yaml b/.github/workflows/coder_nocache.yaml index 20ccc91dc1c57..5d145ef7b849c 100644 --- a/.github/workflows/coder_nocache.yaml +++ b/.github/workflows/coder_nocache.yaml @@ -2,8 +2,8 @@ name: Coder No Cache on: workflow_dispatch: - schedule: - - cron: "*/30 * * * *" + # schedule: + # - cron: "*/30 * * * *" # Cancel in-progress runs for pull requests when developers push # additional changes