Skip to content

Commit

Permalink
chore: format config and template files (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope authored and qwqcode committed Apr 8, 2024
1 parent 16527ec commit 8817518
Show file tree
Hide file tree
Showing 30 changed files with 672 additions and 573 deletions.
70 changes: 35 additions & 35 deletions .circleci/conditional_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,43 @@ parameters:
jobs:
## Backend
test_app:
executor: go
working_directory: ~/go/src/github.com/ArtalkJS/Artalk
environment:
GO111MODULE: "on"
steps:
- checkout
- run:
name: "Print the Go version"
command: >
go version
- restore_cache:
keys:
- go-mod-1.22.1-{{ checksum "go.sum" }}
- run:
name: Install Dependencies
command: go mod download
- save_cache:
key: go-mod-1.22.1-{{ checksum "go.sum" }}
paths:
- "~/go/pkg/mod"
- run:
name: Run tests
command: |
mkdir -p /tmp/test-reports
gotestsum --junitfile /tmp/test-reports/unit-tests.xml -- -coverprofile=/tmp/test-reports/coverage.out ./...
- store_test_results:
path: /tmp/test-reports
- codecov/upload:
flags: go
file: /tmp/test-reports/coverage.out
executor: go
working_directory: ~/go/src/github.com/ArtalkJS/Artalk
environment:
GO111MODULE: 'on'
steps:
- checkout
- run:
name: 'Print the Go version'
command: >
go version
- restore_cache:
keys:
- go-mod-1.22.1-{{ checksum "go.sum" }}
- run:
name: Install Dependencies
command: go mod download
- save_cache:
key: go-mod-1.22.1-{{ checksum "go.sum" }}
paths:
- '~/go/pkg/mod'
- run:
name: Run tests
command: |
mkdir -p /tmp/test-reports
gotestsum --junitfile /tmp/test-reports/unit-tests.xml -- -coverprofile=/tmp/test-reports/coverage.out ./...
- store_test_results:
path: /tmp/test-reports
- codecov/upload:
flags: go
file: /tmp/test-reports/coverage.out

all_projects:
executor: base
steps:
- run:
command: |
echo "all"
executor: base
steps:
- run:
command: |
echo "all"
workflows:
build-app:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ workflows:
mapping: |
(cmd|internal|server|pkg|test|conf)/.* trigger-app true
main.go|go.mod|go.sum trigger-app true
base-revision: master # git branch name
base-revision: master # git branch name
config-path: .circleci/conditional_config.yml
filters:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
description: The content of comment

runs:
using: "composite"
using: 'composite'
steps:
- uses: actions/github-script@v7
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ info:
repository_url: https://github.com/ArtalkJS/Artalk
options:
tag_filter_pattern: '^v'
sort: "date"
sort: date
commits:
filters:
Type:
Expand Down
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
schedule:
interval: monthly
commit-message:
prefix: "chore(deps/go): "
prefix: 'chore(deps/go): '
groups:
deps:
patterns:
Expand All @@ -22,7 +22,7 @@ updates:
schedule:
interval: monthly
commit-message:
prefix: "chore(deps/ui): "
prefix: 'chore(deps/ui): '
groups:
prod-deps:
dependency-type: production
Expand All @@ -35,7 +35,7 @@ updates:
schedule:
interval: monthly
commit-message:
prefix: "chore(deps/docs): "
prefix: 'chore(deps/docs): '
groups:
deps:
patterns:
Expand All @@ -47,7 +47,7 @@ updates:
schedule:
interval: monthly
commit-message:
prefix: "chore(deps/docker): "
prefix: 'chore(deps/docker): '
groups:
deps:
patterns:
Expand All @@ -59,7 +59,7 @@ updates:
schedule:
interval: monthly
commit-message:
prefix: "chore(deps/ci): "
prefix: 'chore(deps/ci): '
groups:
deps:
patterns:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ jobs:

- name: Setup git-chglog
run: |
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
git-chglog --version
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
git-chglog --version
- name: Pre Build
run: |-
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ jobs:
# since docker push actions will override the previous images,
# so need to build `linux/amd64` and push first,
# then build `linux/amd64` twice with other archs (build very slow so keep it last).
target: ["linux/amd64", "linux/amd64,linux/arm64,linux/arm/v7"]
target:
- linux/amd64
- linux/amd64
- linux/arm64
- linux/arm/v7
with:
version: ${{ needs.tagging.outputs.version }}
dry_run: ${{ inputs.dry_run || false }}
Expand Down
67 changes: 35 additions & 32 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ "master" ]
branches:
- master
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches:
- master
schedule:
- cron: '40 17 * * 4'

Expand All @@ -32,43 +34,44 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'go', 'javascript' ]
language:
- go
- javascript
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
2 changes: 1 addition & 1 deletion .github/workflows/docs-cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
cache: pnpm

- name: Install dependencies
run: pnpm install
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:

- name: Setup git-chglog
run: |
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
git-chglog --version
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
git-chglog --version
- name: Version Changelog
run: |
Expand All @@ -72,9 +72,9 @@ jobs:
uses: peter-evans/create-pull-request@v6
if: ${{ !inputs.dry_run }}
with:
branch: "release/${{ env.VERSION }}"
commit-message: "chore: release ${{ env.VERSION }}"
title: "chore: release ${{ env.VERSION }}"
branch: 'release/${{ env.VERSION }}'
commit-message: 'chore: release ${{ env.VERSION }}'
title: 'chore: release ${{ env.VERSION }}'
labels: release
body: |
## Release ${{ env.VERSION }} 📦🚀
Expand Down
Loading

0 comments on commit 8817518

Please sign in to comment.