Format YAML and JSON Files With Prettier (#4304)

* ci: format yaml and json files with prettier

* chore: add changelog entry

* fix: format everything

* ci: run pretter on all files

* ci: rename prettier step
This commit is contained in:
nerix
2023-01-15 17:27:41 +01:00
committed by GitHub
parent f933d9cdf2
commit 2233b46512
20 changed files with 303 additions and 268 deletions
+73 -73
View File
@@ -35,19 +35,19 @@ jobs:
- name: Force LTO
if: matrix.force-lto == true
run: |
echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV"
echo "C2_ENABLE_LTO=ON" >> "$GITHUB_ENV"
shell: bash
- name: Set environment variables for windows-latest
if: matrix.os == 'windows-latest'
run: |
echo "vs_version=2022" >> "$GITHUB_ENV"
echo "vs_version=2022" >> "$GITHUB_ENV"
shell: bash
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # allows for tags access
fetch-depth: 0 # allows for tags access
- name: Install Qt
uses: jurplel/install-qt-action@v3.0.0
@@ -63,7 +63,7 @@ jobs:
uses: actions/cache@v3
with:
key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.txt') }}
path: ~/.conan/
path: ~/.conan/
- name: Cache conan packages part 2
if: startsWith(matrix.os, 'windows')
@@ -79,7 +79,7 @@ jobs:
- name: Install dependencies (Windows)
if: startsWith(matrix.os, 'windows')
run: |
choco install conan -y
choco install conan -y
- name: Enable Developer Command Prompt
if: startsWith(matrix.os, 'windows')
@@ -88,21 +88,21 @@ jobs:
- name: Build (Windows)
if: startsWith(matrix.os, 'windows')
run: |
mkdir build
cd build
conan install .. -b missing
cmake `
-G"NMake Makefiles" `
-DCMAKE_BUILD_TYPE=Release `
-DUSE_CONAN=ON `
-DCHATTERINO_LTO="$Env:C2_ENABLE_LTO" `
..
set cl=/MP
nmake /S /NOLOGO
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
cp bin/chatterino.exe Chatterino2/
echo nightly > Chatterino2/modes
7z a chatterino-windows-x86-64.zip Chatterino2/
mkdir build
cd build
conan install .. -b missing
cmake `
-G"NMake Makefiles" `
-DCMAKE_BUILD_TYPE=Release `
-DUSE_CONAN=ON `
-DCHATTERINO_LTO="$Env:C2_ENABLE_LTO" `
..
set cl=/MP
nmake /S /NOLOGO
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
cp bin/chatterino.exe Chatterino2/
echo nightly > Chatterino2/modes
7z a chatterino-windows-x86-64.zip Chatterino2/
- name: Upload artifact (Windows)
if: startsWith(matrix.os, 'windows')
@@ -120,42 +120,42 @@ jobs:
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install \
cmake \
virtualenv \
rapidjson-dev \
libfuse2 \
libssl-dev \
libboost-dev \
libxcb-randr0-dev \
libboost-system-dev \
libboost-filesystem-dev \
libpulse-dev \
libxkbcommon-x11-0 \
libgstreamer-plugins-base1.0-0 \
build-essential \
libgl1-mesa-dev \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0
sudo apt-get update
sudo apt-get -y install \
cmake \
virtualenv \
rapidjson-dev \
libfuse2 \
libssl-dev \
libboost-dev \
libxcb-randr0-dev \
libboost-system-dev \
libboost-filesystem-dev \
libpulse-dev \
libxkbcommon-x11-0 \
libgstreamer-plugins-base1.0-0 \
build-essential \
libgl1-mesa-dev \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0
- name: Build (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build
cd build
cmake \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
..
make -j"$(nproc)"
mkdir build
cd build
cmake \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
..
make -j"$(nproc)"
shell: bash
- name: clang-tidy review
@@ -164,7 +164,7 @@ jobs:
id: review
with:
build_dir: build
config_file: '.clang-tidy'
config_file: ".clang-tidy"
split_workflow: true
- uses: actions/upload-artifact@v3
@@ -178,15 +178,15 @@ jobs:
- name: Package - AppImage (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
cd build
sh ./../.CI/CreateAppImage.sh
cd build
sh ./../.CI/CreateAppImage.sh
shell: bash
- name: Package - .deb (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
cd build
sh ./../.CI/CreateUbuntuDeb.sh
cd build
sh ./../.CI/CreateUbuntuDeb.sh
shell: bash
- name: Upload artifact - AppImage (Ubuntu)
@@ -207,32 +207,32 @@ jobs:
- name: Install dependencies (MacOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install boost openssl rapidjson p7zip create-dmg cmake tree
brew install boost openssl rapidjson p7zip create-dmg cmake tree
shell: bash
- name: Build (MacOS)
if: startsWith(matrix.os, 'macos')
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
..
make -j"$(sysctl -n hw.logicalcpu)"
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
-DCHATTERINO_LTO="$C2_ENABLE_LTO" \
..
make -j"$(sysctl -n hw.logicalcpu)"
shell: bash
- name: Package (MacOS)
if: startsWith(matrix.os, 'macos')
run: |
ls -la
pwd
ls -la build || true
cd build
sh ./../.CI/CreateDMG.sh
ls -la
pwd
ls -la build || true
cd build
sh ./../.CI/CreateDMG.sh
shell: bash
- name: Upload artifact (MacOS)
+4 -4
View File
@@ -2,8 +2,8 @@ name: Changelog Check
on:
pull_request:
branches: [ master ]
types: [ opened, synchronize, reopened, ready_for_review, labeled, unlabeled ]
branches: [master]
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
jobs:
check-changelog:
@@ -13,5 +13,5 @@ jobs:
- name: Changelog check
uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'no changelog entry needed, ci, submodules'
changeLogPath: "CHANGELOG.md"
skipLabels: "no changelog entry needed, ci, submodules"
+1 -1
View File
@@ -7,7 +7,7 @@ on:
- master
pull_request:
concurrency:
concurrency:
group: check-formatting-${{ github.ref }}
cancel-in-progress: true
+4 -4
View File
@@ -1,9 +1,9 @@
name: 'Publish Homebrew Cask on Release'
name: "Publish Homebrew Cask on Release"
on:
push:
tags:
# Should match semver for mainline releases (not including -beta)
- 'v2.[0-9]+.[0-9]+'
- "v2.[0-9]+.[0-9]+"
# TODO: handle beta and nightly releases
# Need to make those casks manually first
# - v2.[0-9]+.[0-9]+-beta(?:[0-9]+)
@@ -16,8 +16,8 @@ env:
jobs:
update_stable_homebrew_cask:
name: 'Update the stable homebrew cask'
runs-on: 'macos-latest'
name: "Update the stable homebrew cask"
runs-on: "macos-latest"
steps:
# Pulls out the version from the ref (e.g. refs/tags/v2.3.1 -> 2.3.1)
- name: Execute brew bump-cask-pr with version
+3 -3
View File
@@ -7,7 +7,7 @@ on:
- master
pull_request:
concurrency:
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
@@ -18,8 +18,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Lint Markdown files
- name: Check formatting with Prettier
uses: actionsx/prettier@v2
with:
# prettier CLI arguments.
args: --check '**/*.md'
args: --check .
+2 -2
View File
@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Download artifact'
- name: "Download artifact"
uses: actions/github-script@v6
with:
script: |
@@ -32,7 +32,7 @@ jobs:
});
const fs = require('fs');
fs.writeFileSync('${{github.workspace}}/clang-tidy-review.zip', Buffer.from(download.data));
- name: 'Unzip artifact'
- name: "Unzip artifact"
run: unzip clang-tidy-review.zip
- uses: ZedThree/clang-tidy-review/post@v0.10.1
+1 -1
View File
@@ -6,7 +6,7 @@ on:
branches:
- master
concurrency:
concurrency:
group: build-archlinux-${{ github.ref }}
cancel-in-progress: true
+27 -27
View File
@@ -8,7 +8,7 @@ on:
env:
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.5
concurrency:
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
@@ -45,46 +45,46 @@ jobs:
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install \
cmake \
rapidjson-dev \
libssl-dev \
libboost-dev \
libboost-system-dev \
libboost-filesystem-dev \
libpulse-dev \
libxkbcommon-x11-0 \
libgstreamer-plugins-base1.0-0 \
build-essential \
libgl1-mesa-dev \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0
sudo apt-get update
sudo apt-get -y install \
cmake \
rapidjson-dev \
libssl-dev \
libboost-dev \
libboost-system-dev \
libboost-filesystem-dev \
libpulse-dev \
libxkbcommon-x11-0 \
libgstreamer-plugins-base1.0-0 \
build-essential \
libgl1-mesa-dev \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xinerama0
- name: Create build directory (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build-test
mkdir build-test
shell: bash
- name: Build (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
cmake -DBUILD_TESTS=On -DBUILD_APP=OFF ..
cmake --build . --config Release
cmake -DBUILD_TESTS=On -DBUILD_APP=OFF ..
cmake --build . --config Release
working-directory: build-test
shell: bash
- name: Test (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
docker pull kennethreitz/httpbin
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run -p 9051:80 --detach kennethreitz/httpbin
./bin/chatterino-test --platform minimal || ./bin/chatterino-test --platform minimal || ./bin/chatterino-test --platform minimal
docker pull kennethreitz/httpbin
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run -p 9051:80 --detach kennethreitz/httpbin
./bin/chatterino-test --platform minimal || ./bin/chatterino-test --platform minimal || ./bin/chatterino-test --platform minimal
working-directory: build-test
shell: bash