Skip to content

Commit

Permalink
ci: Fix caching and running on every push
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Aug 1, 2024
1 parent 4b91b96 commit 2e68399
Show file tree
Hide file tree
Showing 5 changed files with 905 additions and 738 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
name: Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
on: push

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/npm
key: ${{ runner.OS }}-npm-${{ hashFiles('**/npm.lock') }}
restore-keys: |
${{ runner.OS }}-npm-
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build
Expand Down
21 changes: 5 additions & 16 deletions .github/workflows/fmt.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
name: FormatCheck

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
on: push

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/npm
key: ${{ runner.OS }}-npm-${{ hashFiles('**/npm.lock') }}
restore-keys: |
${{ runner.OS }}-npm-
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint
Expand Down
21 changes: 5 additions & 16 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
name: Lint

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
on: push

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/yarn
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-yarn-
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint
Expand Down
Loading

0 comments on commit 2e68399

Please sign in to comment.