Skip to content

Commit

Permalink
ci: update workflow (#40)
Browse files Browse the repository at this point in the history
* ci: update workflow

* fix: use local checkout sha

* ci: update

* ci: oh god i forget that we runs on windows, instead of linux...

* ci: add prettier ci check

* ci: again... windows... why... kill me plz...

* ci: fck windows again
  • Loading branch information
KotRikD authored Feb 15, 2024
1 parent 5c7f153 commit b660967
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ name: Build and Deploy
on:
push:
branches:
- '*'
- 'master'
tags:
- '*'
- 'v*'
pull_request:
branches:
- '*'

concurrency:
group: build-${{ github.ref_name }}
group: build-${{ github.sha }}
cancel-in-progress: true

permissions:
Expand All @@ -30,6 +28,13 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Set output pr sha
if: github.event_name == 'pull_request'
id: set-pr-sha
shell: bash
run: |
echo "SHORT_PR_SHA=$(git rev-parse HEAD | cut -c 1-7)" >> "$GITHUB_OUTPUT"
- name: Install Node.js 🔧
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -68,5 +73,5 @@ jobs:
if: startsWith( matrix.os, 'windows' )
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ github.ref_name }}
name: tosu-${{ matrix.os }}-${{ steps.set-pr-sha.outputs.SHORT_PR_SHA || github.ref_name }}
path: packages/tosu/dist/tosu.exe
36 changes: 36 additions & 0 deletions .github/workflows/pr_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PR-check

on:
pull_request:

concurrency:
group: lint-${{ github.sha }}
cancel-in-progress: true

jobs:
lint:
#runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Install Node.js 🔧
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Rust 🔧
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
components: clippy

- name: Install Deps 🔧
run: |
npm install -g pnpm@^8
pnpm install --frozen-lockfile
- name: Lint PR
run: |
pnpm run prettier:ci
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"trailingComma": "none",
"quoteProps": "as-needed",
"bracketSpacing": true,
"endOfLine": "lf",
"endOfLine": "auto",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start": "pnpm run -C packages/tosu run:dev",
"build": "pnpm run -C packages/tosu compile",
"release": "standard-version",
"prettier:fix": "prettier --write \"**/*.{js,jsx,ts,tsx,css,scss}\""
"prettier:fix": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
"prettier:ci": "prettier --check \"**/*.{js,jsx,ts,tsx,css}\""
},
"dependencies": {
"@types/node": "^18.14.6",
Expand Down

0 comments on commit b660967

Please sign in to comment.