Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Improvements #3

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/two-dolphins-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'css-preflight': patch
---

Internal updates to stylelint, github actions, and Readme.
9 changes: 9 additions & 0 deletions .github/composite-actions/code-checks/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Code Checks
description: Checks code for compliance using linting, tests, etc.

runs:
using: 'composite'
steps:
- name: Lint Styles
run: pnpm run lint
shell: bash
21 changes: 21 additions & 0 deletions .github/composite-actions/node-setup-ubuntu/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Node Setup Ubuntu
description: Sets up Node, PNPM, and installs packages.

runs:
using: 'composite'
steps:
- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: pnpm

- name: Install Dependencies
run: pnpm install --frozen-lockfile
shell: bash
25 changes: 7 additions & 18 deletions .github/workflows/pr-main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR To Main Branch
name: On PR To Main Branch

on:
pull_request:
Expand All @@ -9,26 +9,15 @@ on:
- main

jobs:
lint:
checks:
name: Code Checks
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Prep Project
uses: ./.github/composite-actions/node-setup-ubuntu

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: pnpm

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Lint Styles
run: pnpm run lint
- name: Code Checks
uses: ./.github/composite-actions/code-checks
29 changes: 11 additions & 18 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
name: Push To Main Branch
name: On Push To Main Branch

on:
push:
branches:
- main

# So no other instances of workflow running at same time
# So no other instances of release workflow run at same time
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Changesets Release Flow
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install PNPM
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: pnpm
- name: Prep Project
uses: ./.github/composite-actions/node-setup-ubuntu

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Lint Styles
run: pnpm run lint
- name: Code Checks
uses: ./.github/composite-actions/code-checks

- name: 1Password Load Tokens
id: op-tokens
Expand All @@ -49,3 +38,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: set in steps.op-tokens (export-env: true)

- name: Regen Readme NPM Badge
run: curl -X GET "https://img.shields.io/npm/v/css-preflight?color=red"
shell: bash
8 changes: 7 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"$schema": "https://json.schemastore.org/stylelintrc.json",
"extends": "stylelint-config-standard"
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-prettier"
],
"rules": {
"prettier/prettier": true
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"devDependencies": {
"@changesets/cli": "2.27.1",
"stylelint": "15.11.0",
"stylelint-config-standard": "34.0.0"
"stylelint-config-standard": "34.0.0",
"stylelint-prettier": "4.1.0"
}
}
32 changes: 32 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.