diff --git a/.editorconfig b/.editorconfig index 80ff443..d509d00 100644 --- a/.editorconfig +++ b/.editorconfig @@ -21,3 +21,8 @@ trim_trailing_whitespace = true [*.gleam] indent_style = space indent_size = 2 + +# YAML cannot handle tabs +[*.{yml,yaml}] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/check-copyright.yml b/.github/workflows/check-copyright.yml new file mode 100644 index 0000000..87cf711 --- /dev/null +++ b/.github/workflows/check-copyright.yml @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2024 Shota FUJI +# +# SPDX-License-Identifier: Apache-2.0 + +name: Check copyright attributions + +on: + push: + # Runs on every push + branches: + - "*" + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run REUSE lint tool + uses: fsfe/reuse-action@v5 diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml new file mode 100644 index 0000000..430fe0e --- /dev/null +++ b/.github/workflows/check-format.yml @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: 2024 Shota FUJI +# +# SPDX-License-Identifier: Apache-2.0 + +name: Check files are correctly formatted + +on: + push: + # Runs on every push + branches: + - "*" + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Gleam + uses: erlef/setup-beam@v1 + with: + # Reading of `.tool-versions` in setup-beam is very limited: it only supports + # fully specified version strings, such as 1.2.3. + otp-version: "27" + gleam-version: "1.6" + + - name: Check format with dprint + uses: dprint/check@v2.2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..10619c5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,41 @@ +# SPDX-FileCopyrightText: 2024 Shota FUJI +# +# SPDX-License-Identifier: Apache-2.0 + +name: Run tests + +on: + push: + # Runs on every push + branches: + - "*" + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Gleam + uses: erlef/setup-beam@v1 + with: + # Reading of `.tool-versions` in setup-beam is very limited: it only supports + # fully specified version strings, such as 1.2.3. + otp-version: "27" + gleam-version: "1.6" + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .tool-versions + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Check types + run: npx tsc diff --git a/dprint.jsonc b/dprint.jsonc index f96a75f..5770a67 100644 --- a/dprint.jsonc +++ b/dprint.jsonc @@ -13,6 +13,7 @@ "toml": { "useTabs": true }, + "yaml": {}, "exec": { "commands": [ { @@ -26,6 +27,7 @@ "https://plugins.dprint.dev/markdown-0.17.8.wasm", "https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0", "https://plugins.dprint.dev/toml-0.6.3.wasm", - "https://plugins.dprint.dev/biome-0.7.1.wasm" + "https://plugins.dprint.dev/biome-0.7.1.wasm", + "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm" ] }