Skip to content

Commit

Permalink
Setup GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pocka committed Nov 25, 2024
1 parent 656a1bf commit c30e974
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 21 additions & 0 deletions .github/workflows/check-copyright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>
#
# 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
29 changes: 29 additions & 0 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>
#
# 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
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SPDX-FileCopyrightText: 2024 Shota FUJI <pockawoooh@gmail.com>
#
# 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
4 changes: 3 additions & 1 deletion dprint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"toml": {
"useTabs": true
},
"yaml": {},
"exec": {
"commands": [
{
Expand All @@ -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"
]
}

0 comments on commit c30e974

Please sign in to comment.