From 5b3e9781414d4a9e8d17989b1e7a5fbe094d87df Mon Sep 17 00:00:00 2001 From: tdakkota Date: Sat, 5 Mar 2022 21:49:23 +0300 Subject: [PATCH 1/2] ci: drop arm64 runner --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c4089e..b055c57 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,9 +29,6 @@ jobs: runner: ubuntu-latest flags: "-race" go: 1.17 - - arch: arm64 - runner: self-hosted - go: 1.17 steps: - name: Checkout code uses: actions/checkout@v2.4.0 From 95b8a4e4cdc2daabff40fd3b86f24557326c1251 Mon Sep 17 00:00:00 2001 From: tdakkota Date: Sat, 5 Mar 2022 21:49:35 +0300 Subject: [PATCH 2/2] ci: use go-faster/x workflows --- .github/workflows/codeql.yml | 38 +--------------- .github/workflows/commit.yml | 10 +---- .github/workflows/lint.yml | 85 +----------------------------------- .github/workflows/nancy.yml | 18 +------- 4 files changed, 8 insertions(+), 143 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cb54d9b..765f9f2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -7,39 +7,5 @@ on: workflow_dispatch: jobs: - analyze: - name: analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - - name: Install Go - uses: actions/setup-go@v2.2.0 - with: - go-version: 1.17 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + codeql: + uses: go-faster/x/.github/workflows/codeql.yml@main diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 325e745..4c4c9c9 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -7,11 +7,5 @@ on: workflow_dispatch: jobs: - lint: - runs-on: ubuntu-latest - if: github.actor != 'dependabot[bot]' - steps: - - uses: actions/checkout@v2.4.0 - with: - fetch-depth: 0 - - uses: wagoid/commitlint-github-action@v4.1.9 + commit: + uses: go-faster/x/.github/workflows/commit.yml@main diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 894597f..9aeb318 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,86 +7,5 @@ on: workflow_dispatch: jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2.4.0 - - - name: Install Go - uses: actions/setup-go@v2.2.0 - with: - go-version: 1.17 - - - name: Lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest - args: --timeout 5m - skip-go-installation: true - - # Check if there are any dirty changes after go mod tidy - mod: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2.4.0 - - - name: Install Go - uses: actions/setup-go@v2.2.0 - with: - go-version: 1.17 - - - name: Get Go environment - id: go-env - run: | - echo "::set-output name=cache::$(go env GOCACHE)" - echo "::set-output name=modcache::$(go env GOMODCACHE)" - - name: Set up cache - uses: actions/cache@v2.1.7 - with: - path: | - ${{ steps.go-env.outputs.cache }} - ${{ steps.go-env.outputs.modcache }} - key: check-mod-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - check-mod-${{ runner.os }}-go- - - - name: Tidy - run: go mod tidy - - - name: Check git diff - run: git diff --exit-code - - # Check if there are any dirty changes after go generate - gen: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2.4.0 - - - name: Install Go - uses: actions/setup-go@v2.2.0 - with: - go-version: 1.17 - - - name: Get Go environment - id: go-env - run: | - echo "::set-output name=cache::$(go env GOCACHE)" - echo "::set-output name=modcache::$(go env GOMODCACHE)" - - name: Set up cache - uses: actions/cache@v2.1.7 - with: - path: | - ${{ steps.go-env.outputs.cache }} - ${{ steps.go-env.outputs.modcache }} - key: check-generate-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - check-generate-${{ runner.os }}-go- - - - name: Generate - run: go generate ./... - - - name: Check git diff - run: git diff --exit-code + lint: + uses: go-faster/x/.github/workflows/lint.yml@main diff --git a/.github/workflows/nancy.yml b/.github/workflows/nancy.yml index 33341a4..85561bd 100644 --- a/.github/workflows/nancy.yml +++ b/.github/workflows/nancy.yml @@ -7,19 +7,5 @@ on: workflow_dispatch: jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2.4.0 - - - name: Install Go - uses: actions/setup-go@v2.2.0 - with: - go-version: 1.17 - - - name: List dependencies - run: go list -json -m all > go.list - - - name: Run nancy - uses: sonatype-nexus-community/nancy-github-action@v1.0.2 + nancy: + uses: go-faster/x/.github/workflows/nancy.yml@main