From 61db806f054980fd98108f97376f4370c423fff9 Mon Sep 17 00:00:00 2001 From: Timothy Stewart Date: Fri, 21 Feb 2025 22:34:16 -0600 Subject: [PATCH 1/3] feat(ci): GitHub action for pull requests --- .github/workflows/pull-request.yml | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..8c0e96b --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,37 @@ +name: 'Pull Request' +on: + pull_request: + branches: + - dev + paths-ignore: + - .gitignore + - README.md + - LICENSE + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: v21.1.0 + cache: 'npm' + + - name: Install Dependencies and Build + run: | + npm ci + npx prisma generate + npm run build:prod + + env: + CI: true + + - name: Cache Prisma Binary + uses: actions/cache@v4 + with: + path: ~/.npm/_npx + key: prisma-binary-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: prisma-binary-${{ runner.os }}- \ No newline at end of file From cf1df9e6ed63c8fd15d5af8978cdae0ccf7cdeaa Mon Sep 17 00:00:00 2001 From: Timothy Stewart Date: Fri, 21 Feb 2025 23:27:11 -0600 Subject: [PATCH 2/3] feat(ci): base cache key on package-lock.json --- .github/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8c0e96b..379d34b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -19,6 +19,7 @@ jobs: with: node-version: v21.1.0 cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Install Dependencies and Build run: | From a27d783451f66ab64f9787bb79806ae2ff9954f8 Mon Sep 17 00:00:00 2001 From: Timothy Stewart Date: Sun, 23 Feb 2025 22:27:13 -0600 Subject: [PATCH 3/3] feat(ci): base cache key on package-lock.json --- .github/workflows/pull-request.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 379d34b..fc46281 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,12 +21,19 @@ jobs: cache: 'npm' cache-dependency-path: '**/package-lock.json' + - name: Cache NPM dependencies + uses: actions/cache@v4 + with: + path: ~/.npm + key: npm-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-cache-${{ runner.os }}- + - name: Install Dependencies and Build run: | npm ci npx prisma generate npm run build:prod - env: CI: true @@ -35,4 +42,4 @@ jobs: with: path: ~/.npm/_npx key: prisma-binary-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - restore-keys: prisma-binary-${{ runner.os }}- \ No newline at end of file + restore-keys: prisma-binary-${{ runner.os }}-