v2023.3 #296
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'CI' | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: golangci-lint | |
uses: golangci/[email protected] | |
with: | |
version: latest | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: [ lint ] | |
permissions: | |
checks: write | |
pull-requests: write | |
actions: read | |
contents: write | |
security-events: write | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Set up gotestfmt | |
uses: gotesttools/gotestfmt-action@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: docker/login-action@v3 | |
with: | |
registry: registry.jetbrains.team | |
username: ${{ secrets.SPACE_USERNAME }} | |
password: ${{ secrets.SPACE_PASSWORD }} | |
- if: startsWith(matrix.os, 'windows') | |
name: Run Windows tests | |
run: go test -v ./... | |
env: | |
QODANA_LICENSE_ONLY_TOKEN: ${{ secrets.QODANA_LICENSE_ONLY_TOKEN }} | |
- if: startsWith(matrix.os, 'macos') | |
name: Run macOS tests | |
run: | | |
set -euo pipefail | |
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt | |
env: | |
QODANA_LICENSE_ONLY_TOKEN: ${{ secrets.QODANA_LICENSE_ONLY_TOKEN }} | |
- if: startsWith(matrix.os, 'ubuntu') | |
name: Run Linux tests (with coverage) | |
run: | | |
set -euo pipefail | |
mkdir -p .qodana/code-coverage | |
go test -json -v ./... -coverprofile .qodana/code-coverage/coverage.out -coverpkg=./... 2>&1 | tee /tmp/gotest.log | gotestfmt | |
env: | |
QODANA_LICENSE_ONLY_TOKEN: ${{ secrets.QODANA_LICENSE_ONLY_TOKEN }} | |
- if: startsWith(matrix.os, 'ubuntu') | |
uses: JetBrains/qodana-action@main | |
env: | |
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} | |
with: | |
args: --fail-threshold,0 | |
- if: startsWith(matrix.os, 'ubuntu') | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: go | |
- if: startsWith(matrix.os, 'ubuntu') | |
uses: github/codeql-action/autobuild@v2 | |
- if: startsWith(matrix.os, 'ubuntu') | |
uses: github/codeql-action/analyze@v2 | |
- if: startsWith(matrix.os, 'ubuntu') | |
name: install chocolatey | |
run: | | |
mkdir -p /opt/chocolatey | |
wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey" | |
echo '#!/bin/bash' >> /usr/local/bin/choco | |
echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco | |
chmod +x /usr/local/bin/choco | |
env: | |
CHOCOLATEY_VERSION: 1.2.0 | |
- if: startsWith(matrix.os, 'ubuntu') | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: --snapshot --clean --debug | |
- if: startsWith(matrix.os, 'ubuntu') && github.ref == 'refs/heads/233' | |
run: | | |
cd dist | |
gh release --repo JetBrains/qodana-cli delete nightly -y || true | |
git push --delete origin nightly || true | |
gh release --repo JetBrains/qodana-cli create nightly -p -t nightly | |
gh release --repo JetBrains/qodana-cli upload nightly \ | |
qodana_darwin_all.tar.gz \ | |
qodana_linux_arm64.tar.gz \ | |
qodana_linux_x86_64.tar.gz \ | |
qodana_windows_arm64.zip \ | |
qodana_windows_x86_64.zip | |
gh release --repo JetBrains/qodana-cli edit nightly --draft=false | |
env: | |
GH_TOKEN: ${{ github.token }} | |
install-script-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
./install |