Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger committed Sep 19, 2023
0 parents commit 3ebc7c6
Show file tree
Hide file tree
Showing 19 changed files with 16,495 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
insert_final_newline = false

[*.{yml,yaml}]
indent_size = 2
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [ nhedger ]
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "@types/node"
update-types: ["semver-major"]

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
49 changes: 49 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Integrate

on:
push:
branches: [ main, "releases/v*" ]
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: true

- name: Build action
run: pnpm build

- name: Package action
run: pnpm package

coding-standards:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: true

- name: Run Biome
run: pnpm biome ci .
26 changes: 26 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test

on:
push:
branches: [ main, "releases/v*"]
pull_request:
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
version: [ "latest", "1.2.0" ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome CLI
uses: ./
with:
version: ${{ matrix.version }}
- name: Test the CLI
run: biome version
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.idea/
/build/
/node_modules/
25 changes: 25 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
The MIT License (MIT)
=====================

Copyright © `2023` `Nicolas Hedger`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Setup Biome CLI in GitHub Actions

[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nhedger/setup-biome?label=latest&logo=github)](https://github.com/marketplace/actions/setup-biome)
[![Test](https://github.com/nhedger/setup-biome/actions/workflows/test.yaml/badge.svg)](https://github.com/nhedger/setup-biome/actions/workflows/test.yaml)
[![Integrate](https://github.com/nhedger/setup-biome/actions/workflows/integrate.yaml/badge.svg)](https://github.com/nhedger/setup-biome/actions/workflows/integrate.yaml)

**Setup Biome** is a GitHub action that provides a cross-platform interface
for setting up the [Biome CLI](https://biomejs.dev) in GitHub
Actions runners.

## Inputs

The following inputs are supported.

```yaml
- name: Setup Biome
uses: nhedger/setup-biome@v1
with:

# The version of the Biome CLI to install.
# This input is optional and defaults to "latest".
# Example values: "1.2.0", "latest"
version: "latest"

# The GitHub token to use to authenticate GitHub API requests.
# This input is optional and defaults to the job's GitHub token.
# Example value: ${{ secrets.GITHUB_TOKEN }}
token: ${{ github.token }}
```
## Examples
### Basic example
Setup the latest version of the Biome CLI.
```yaml
- name: Setup Biome CLI
uses: nhedger/setup-biome@v1

- name: Run Biome
run: biome ci .
```
### Specific version
Install version `1.2.0` of the Biome CLI.

```yaml
- name: Setup Biome CLI
uses: nhedger/setup-biome@v1
with:
version: 1.2.0
- name: Run Biome
run: biome ci .
```

## License

The scripts and documentation in this project are licensed under
the [MIT License](LICENSE.md).
18 changes: 18 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup Biome
author: nhedger
description: Setup the Biome CLI in GitHub Actions
branding:
color: yellow
icon: terminal
inputs:
token:
description: GitHub Actions token to authenticate API requests
required: true
default: ${{ github.token }}
version:
description: The version of the Biome CLI to install
required: true
default: latest
runs:
using: 'node20'
main: 'dist/index.mjs'
15 changes: 15 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://biomejs.dev/schemas/1.2.2/schema.json",
"files": {
"ignore": ["node_modules/**/*", "dist/**/*"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
6 changes: 6 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineBuildConfig } from "unbuild";

export default defineBuildConfig({
entries: ["./src/index"],
outDir: "build",
});
Loading

0 comments on commit 3ebc7c6

Please sign in to comment.