Skip to content

Commit

Permalink
Cleanup and improvements
Browse files Browse the repository at this point in the history
- Added GitHub action for running the unit test
- Fixed the unit test to pass
- Added badges to the README
- Added .npmignore to exclude the GitHub Actions
  and the unit tests from the published NPM package
  • Loading branch information
lslezak committed Dec 9, 2024
1 parent dd67fb6 commit 6126900
Show file tree
Hide file tree
Showing 8 changed files with 1,050 additions and 11 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Run the tests

name: CI

on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest

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

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"

- name: Install NPM packages
run: npm ci

- name: Run tests
run: npm test
14 changes: 9 additions & 5 deletions .github/workflows/publish-npm-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Git Checkout
uses: actions/checkout@v4

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
# TODO: enable unit tests
# - run: npm ci
- run: npm publish

- name: Publish the NPM package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
*.tgz
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github/
*.test.js
*.tgz
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# The ESLint Plugin

![NPM Version](https://img.shields.io/npm/v/eslint-plugin-agama-i18n)
[![CI](https://github.com/agama-project/eslint-plugin-agama-i18n/actions/workflows/ci.yml/badge.svg)](https://github.com/agama-project/eslint-plugin-agama-i18n/actions/workflows/ci.yml)

This directory contains a simple ESLint plugin which checks that only string
literals are passed to the translation functions.

Expand Down
Loading

0 comments on commit 6126900

Please sign in to comment.