Migrate to eslint 9.1 #314
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: deploy | |
on: | |
push: | |
pull_request: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
permissions: write-all | |
jobs: | |
lint-ts: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache-dependency-path: './frontend/pnpm-lock.yaml' | |
cache: 'pnpm' | |
- name: Install modules | |
working-directory: ./frontend | |
run: pnpm install --frozen-lockfile | |
- name: Prettier | |
working-directory: ./frontend | |
run: pnpm run prettier:check | |
- name: ESLint | |
working-directory: ./frontend | |
run: pnpm run eslint:check | |
lint-golangci: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: 'latest' | |
args: --timeout=10m | |
staticcheck: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- run: go install honnef.co/go/tools/cmd/staticcheck@latest | |
- run: make static | |
lint-codeql: | |
name: Analyze | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [ 'go', 'javascript' ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v2 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
tests: | |
needs: [lint-ts, lint-golangci, lint-codeql, staticcheck] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Run tests | |
run: make test | |
release: | |
name: "bd release" | |
runs-on: "ubuntu-latest" | |
needs: [tests] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: git fetch --force --tags | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache-dependency-path: './frontend/pnpm-lock.yaml' | |
cache: 'pnpm' | |
- name: Install modules | |
working-directory: ./frontend | |
run: pnpm install --frozen-lockfile | |
- name: Build frontend | |
working-directory: ./frontend | |
run: pnpm build | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- run: go mod tidy | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
- uses: goreleaser/goreleaser-action@v5 | |
if: success() && startsWith(github.ref, 'refs/tags/v') | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }} | |
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
- name: Upload snapshot | |
if: success() && ${{ startsWith(github.ref, 'refs/tags/v') }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: snapshot | |
path: build/* | |
retention-days: 1 | |