From e627efdff338e8c1c4764f52d880d52d63623a85 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 02:47:31 +0200 Subject: [PATCH 01/73] setup auto build --- .github/workflows/1-setup_automated_build | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/1-setup_automated_build diff --git a/.github/workflows/1-setup_automated_build b/.github/workflows/1-setup_automated_build new file mode 100644 index 0000000..0226f8e --- /dev/null +++ b/.github/workflows/1-setup_automated_build @@ -0,0 +1,39 @@ +# This is a basic workflow to help you get started with Actions + +name: ๐Ÿ”Ž Get Started + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "demo-ci" ] + pull_request: + branches: [ "demo-ci" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + name: ๐Ÿณ Build + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + # Runs a single command using the runners shell + - name: ๐Ÿ‘Ÿ Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: ๐Ÿƒ๐Ÿผ๐Ÿƒ๐Ÿผ Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. + From bd1bd639c2a32046289fad3a87ce46503a7d7255 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 02:50:20 +0200 Subject: [PATCH 02/73] add yml extension --- .../{1-setup_automated_build => 1-setup_automated_build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{1-setup_automated_build => 1-setup_automated_build.yml} (100%) diff --git a/.github/workflows/1-setup_automated_build b/.github/workflows/1-setup_automated_build.yml similarity index 100% rename from .github/workflows/1-setup_automated_build rename to .github/workflows/1-setup_automated_build.yml From f4ee78b0d4b4b080e834a0f806616f0c8b0592a1 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:11:43 +0200 Subject: [PATCH 03/73] multi versions & os --- .github/workflows/2-multi_os.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/2-multi_os.yml diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml new file mode 100644 index 0000000..9415392 --- /dev/null +++ b/.github/workflows/2-multi_os.yml @@ -0,0 +1,46 @@ + # This is a basic workflow to help you get started with Actions + +name: Multi Versions + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "demo-step1" ] + pull_request: + branches: [ "demo-step1" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + exemple_multi_version: + name: โšก๏ธ Use many os & node versions + strategy: + # continuer ร  excuter les autres workflow si un รฉchoue !!! :) + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest] + node: [12, 14, 16] + include: + - os: windows-latest + node: 16 + npm: 6 + + runs-on: ${{ matrix.os }} + steps: + - name: โš™๏ธ Setup node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: ๐Ÿ”ง only install on windows npm 6 + if: ${{ matrix.npm }} + run: npm install -g npm@${{ matrix.npm }} + + - name: ๐Ÿ‘€ Read npm version + run: npm --version + + - name: ๐Ÿ”– Read node version + run: node --v \ No newline at end of file From 4acbae2f6189ef2f5c3c43702c0b3a92587277ef Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:12:46 +0200 Subject: [PATCH 04/73] use demo-ci branch --- .github/workflows/2-multi_os.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml index 9415392..1f74f2b 100644 --- a/.github/workflows/2-multi_os.yml +++ b/.github/workflows/2-multi_os.yml @@ -6,9 +6,9 @@ name: Multi Versions on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "demo-step1" ] + branches: [ "demo-ci" ] pull_request: - branches: [ "demo-step1" ] + branches: [ "demo-ci" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From 9f0da4b6505abcf49a0beaa751cbfde52b970b69 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:14:55 +0200 Subject: [PATCH 05/73] improve look & feel --- .github/workflows/2-multi_os.yml | 6 +++--- .github/workflows/multiOs.yml | 37 -------------------------------- 2 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/multiOs.yml diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml index 1f74f2b..4f85ee2 100644 --- a/.github/workflows/2-multi_os.yml +++ b/.github/workflows/2-multi_os.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions - -name: Multi Versions + # and how use multi OS & Versions +name: ๐Ÿฆ‘ Multi OS & Versions # Controls when the workflow will run on: @@ -16,7 +16,7 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: exemple_multi_version: - name: โšก๏ธ Use many os & node versions + name: ๐Ÿ™ Use many os & node versions strategy: # continuer ร  excuter les autres workflow si un รฉchoue !!! :) fail-fast: false diff --git a/.github/workflows/multiOs.yml b/.github/workflows/multiOs.yml deleted file mode 100644 index 7635afb..0000000 --- a/.github/workflows/multiOs.yml +++ /dev/null @@ -1,37 +0,0 @@ - # This is a basic workflow to help you get started with Actions - -name: Multi Versions - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "demo-step1" ] - pull_request: - branches: [ "demo-step1" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - exemple_multi_version: - name: โšก๏ธ Use many os & node versions - strategy: - # continuer ร  excuter les autres workflow si un รฉchoue !!! :) - fail-fast: false - matrix: - os: [windows-latest, ubuntu-latest] - node: [12, 14, 16] - include: - - os: windows-latest - node: 16 - npm: 6 - runs-on: ${{ matrix.os }} - steps: - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - if: ${{ matrix.npm }} - run: npm install -g npm@${{ matrix.npm }} - - run: npm --version \ No newline at end of file From 137756dec952718cf82d8284798702b24ca402ba Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:16:13 +0200 Subject: [PATCH 06/73] add comment --- .github/workflows/2-multi_os.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml index 4f85ee2..2d39528 100644 --- a/.github/workflows/2-multi_os.yml +++ b/.github/workflows/2-multi_os.yml @@ -42,5 +42,6 @@ jobs: - name: ๐Ÿ‘€ Read npm version run: npm --version + #error, should use -v - name: ๐Ÿ”– Read node version run: node --v \ No newline at end of file From a62315736342e17c6417fbb84fd63f692f2033ad Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:16:46 +0200 Subject: [PATCH 07/73] test fix --- .github/workflows/2-multi_os.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml index 2d39528..4507d8c 100644 --- a/.github/workflows/2-multi_os.yml +++ b/.github/workflows/2-multi_os.yml @@ -44,4 +44,4 @@ jobs: #error, should use -v - name: ๐Ÿ”– Read node version - run: node --v \ No newline at end of file + run: node -v \ No newline at end of file From 003babb96283dc8f35801f26d4aedbf06838b94d Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:21:40 +0200 Subject: [PATCH 08/73] add error to fail build --- .github/workflows/2-multi_os.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml index 4507d8c..f7e046d 100644 --- a/.github/workflows/2-multi_os.yml +++ b/.github/workflows/2-multi_os.yml @@ -35,7 +35,7 @@ jobs: with: node-version: ${{ matrix.node }} - - name: ๐Ÿ”ง only install on windows npm 6 + - name: ๐Ÿ”ง only install on windows & node version is 16 if: ${{ matrix.npm }} run: npm install -g npm@${{ matrix.npm }} @@ -44,4 +44,4 @@ jobs: #error, should use -v - name: ๐Ÿ”– Read node version - run: node -v \ No newline at end of file + run: node --v \ No newline at end of file From 79176e68046ec1373b49c9fb3f718f675a17d1b1 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:53:24 +0200 Subject: [PATCH 09/73] linting & typescheck --- .github/workflows/3-Linting_Typecheck.yml | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/3-Linting_Typecheck.yml diff --git a/.github/workflows/3-Linting_Typecheck.yml b/.github/workflows/3-Linting_Typecheck.yml new file mode 100644 index 0000000..cfd8167 --- /dev/null +++ b/.github/workflows/3-Linting_Typecheck.yml @@ -0,0 +1,58 @@ +name: ๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž +on: + push: + branches: + - main + - dev + - demo-ci + pull_request: {} +permissions: + actions: write + contents: read + +jobs: + lint: + name: โฌฃ ESLint + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ๐Ÿ”ฌ Lint + run: npm run lint + + typecheck: + name: สฆ TypeScript + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ๐Ÿ”Ž Type check + run: npm run typecheck --if-present From e09238e3e45f61e3c996bd97ebb5f24aefe3943b Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 03:59:03 +0200 Subject: [PATCH 10/73] test lint --- app/root.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index 82f033b..07468e2 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -39,11 +39,9 @@ export const loader: LoaderFunction = async ({ request }) => { export default function App() { return ( - - + - - + From f6e6c48d3c6969d28df7a80218a04ee809baaf98 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:01:44 +0200 Subject: [PATCH 11/73] provoke eslint error --- app/root.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index 07468e2..1859e34 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -15,6 +15,7 @@ import { import tailwindStylesheetUrl from "./styles/tailwind.css"; import { getUser } from "./session.server"; +import { getUserFromSession } from "./session.server"; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: tailwindStylesheetUrl }]; @@ -39,9 +40,11 @@ export const loader: LoaderFunction = async ({ request }) => { export default function App() { return ( - + + - + + From baf35ebe4dfb6664c3c0a5459270fb399f295df9 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:05:50 +0200 Subject: [PATCH 12/73] eslint error --- .github/workflows/3-Linting_Typecheck.yml | 2 -- app/root.tsx | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/3-Linting_Typecheck.yml b/.github/workflows/3-Linting_Typecheck.yml index cfd8167..8fb51a4 100644 --- a/.github/workflows/3-Linting_Typecheck.yml +++ b/.github/workflows/3-Linting_Typecheck.yml @@ -2,8 +2,6 @@ name: ๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž on: push: branches: - - main - - dev - demo-ci pull_request: {} permissions: diff --git a/app/root.tsx b/app/root.tsx index 1859e34..a9f818f 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -15,7 +15,8 @@ import { import tailwindStylesheetUrl from "./styles/tailwind.css"; import { getUser } from "./session.server"; -import { getUserFromSession } from "./session.server"; +// uncomment me to provoke eslint error for demo purposes +// import { getUserFromSession } from "./session.server"; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: tailwindStylesheetUrl }]; @@ -38,6 +39,7 @@ export const loader: LoaderFunction = async ({ request }) => { }; export default function App() { + debugger; return ( From 2477e4425c01600fd7e25a72e2f1c466df5a5385 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:10:37 +0200 Subject: [PATCH 13/73] remove debugger; --- app/root.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/root.tsx b/app/root.tsx index a9f818f..1f4523b 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -39,7 +39,6 @@ export const loader: LoaderFunction = async ({ request }) => { }; export default function App() { - debugger; return ( From 060b045879abf0f8b6f9521006a2ccdea1bdd104 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:33:23 +0200 Subject: [PATCH 14/73] add caching ( before ) --- .github/workflows/4-caching.yml | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/4-caching.yml diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml new file mode 100644 index 0000000..debedef --- /dev/null +++ b/.github/workflows/4-caching.yml @@ -0,0 +1,54 @@ +name: ๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž +on: + push: + branches: + - demo-ci + pull_request: {} +permissions: + actions: write + contents: read + +jobs: + lint: + name: โฌฃ ESLint + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + run: npm install + + - name: ๐Ÿ”ฌ Lint + run: npm run lint + + typecheck: + name: สฆ TypeScript + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ๐Ÿ”Ž Type check + run: npm run typecheck --if-present From e03b2b779af66c970906103c032e0c035bb92382 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:37:05 +0200 Subject: [PATCH 15/73] enable caching --- .github/workflows/4-caching.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index debedef..d7709d7 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -1,4 +1,4 @@ -name: ๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž +name: ๐Ÿช„ Caching โœจmagicโœจ on: push: branches: @@ -23,8 +23,29 @@ jobs: uses: actions/setup-node@v3 with: node-version: 16 + cache: 'npm' - - name: ๐Ÿ“ฅ Download deps + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + + - name: ๐Ÿ“ฅ Download deps โœจwith magicโœจ run: npm install - name: ๐Ÿ”ฌ Lint From 663db078c65b73329c7f0625b693622ef62648c4 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:38:36 +0200 Subject: [PATCH 16/73] now cache should work --- .github/workflows/4-caching.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index d7709d7..81c1785 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -45,7 +45,7 @@ jobs: run: npm list - - name: ๐Ÿ“ฅ Download deps โœจwith magicโœจ + - name: ๐Ÿ“ฅ Download deps โœจwith magic cache ๐Ÿ”ฎ โœจ run: npm install - name: ๐Ÿ”ฌ Lint From 7934ed086ceebbb6e21e00db971d7c781be71359 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:40:20 +0200 Subject: [PATCH 17/73] npm caching --- .github/workflows/npm-cache.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/npm-cache.yml diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml new file mode 100644 index 0000000..58380d4 --- /dev/null +++ b/.github/workflows/npm-cache.yml @@ -0,0 +1,38 @@ +name: Caching with npm +on: push + push: + branches: + - demo-ci +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} + name: List the state of node modules + continue-on-error: true + run: npm list + + - name: Install dependencies + run: npm install + + - name: Build + run: npm build + + - name: Test + run: npm test \ No newline at end of file From c3f6249d708ad9f49aaceb93053943977b0194ee Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:42:08 +0200 Subject: [PATCH 18/73] fix push syntax --- .github/workflows/npm-cache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml index 58380d4..cbad25c 100644 --- a/.github/workflows/npm-cache.yml +++ b/.github/workflows/npm-cache.yml @@ -1,5 +1,5 @@ name: Caching with npm -on: push +on: push: branches: - demo-ci From a57fa36f6be98eaf2f14c9f243a027d4df4e70f6 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:44:13 +0200 Subject: [PATCH 19/73] run lint for test cache --- .github/workflows/npm-cache.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml index cbad25c..a765d9c 100644 --- a/.github/workflows/npm-cache.yml +++ b/.github/workflows/npm-cache.yml @@ -31,8 +31,5 @@ jobs: - name: Install dependencies run: npm install - - name: Build - run: npm build - - - name: Test - run: npm test \ No newline at end of file + - name: ๐Ÿ”ฌ Lint + run: npm run lint \ No newline at end of file From 2e3e868670c04b919b01a0c9be44964c024b530a Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 04:54:46 +0200 Subject: [PATCH 20/73] another try for caching --- .github/workflows/npm-cache.yml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml index a765d9c..19f016e 100644 --- a/.github/workflows/npm-cache.yml +++ b/.github/workflows/npm-cache.yml @@ -9,24 +9,23 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules + - name: โŽ” Setup node + uses: actions/setup-node@v3 with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + node-version: 16 + cache: 'npm' - - if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} - name: List the state of node modules - continue-on-error: true - run: npm list + - name: Get npm cache directory + id: npm-cache-dir + run: | + echo "::set-output name=dir::$(npm config get cache)" + - uses: actions/cache@v3 + id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- - name: Install dependencies run: npm install From d8d8f16194f259d299a0961fd20ce22c099bd98b Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:03:38 +0200 Subject: [PATCH 21/73] use bahmutov action for cache --- .github/workflows/4-caching.yml | 30 ++++------------------- .github/workflows/npm-cache.yml | 43 +++++++++++++++++---------------- 2 files changed, 27 insertions(+), 46 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 81c1785..7c3e280 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -25,28 +25,10 @@ jobs: node-version: 16 cache: 'npm' - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules + - name: ๐Ÿ“ฅ Download deps โœจwith magic cache ๐Ÿ”ฎ โœจ + uses: bahmutov/npm-install@v1 with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} - name: List the state of node modules - continue-on-error: true - run: npm list - - - - name: ๐Ÿ“ฅ Download deps โœจwith magic cache ๐Ÿ”ฎ โœจ - run: npm install + useLockFile: false - name: ๐Ÿ”ฌ Lint run: npm run lint @@ -66,10 +48,8 @@ jobs: with: node-version: 16 - - name: ๐Ÿ“ฅ Download deps - uses: bahmutov/npm-install@v1 - with: - useLockFile: false + - name: ๐Ÿ“ฅ Download deps without cache + run: npm install - name: ๐Ÿ”Ž Type check run: npm run typecheck --if-present diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml index 19f016e..d9c7fce 100644 --- a/.github/workflows/npm-cache.yml +++ b/.github/workflows/npm-cache.yml @@ -1,34 +1,35 @@ name: Caching with npm -on: - push: - branches: - - demo-ci +on: push jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: โŽ” Setup node - uses: actions/setup-node@v3 + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules with: - node-version: 16 - cache: 'npm' - - - name: Get npm cache directory - id: npm-cache-dir - run: | - echo "::set-output name=dir::$(npm config get cache)" - - uses: actions/cache@v3 - id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' - with: - path: ${{ steps.npm-cache-dir.outputs.dir }} - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-node- + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} + name: List the state of node modules + continue-on-error: true + run: npm list - name: Install dependencies run: npm install - - name: ๐Ÿ”ฌ Lint - run: npm run lint \ No newline at end of file + - name: Build + run: npm build + + - name: Test + run: npm test \ No newline at end of file From 09c38252624181f01253524bc2f36efe6f0a5641 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:04:07 +0200 Subject: [PATCH 22/73] use 1.6 version of bahmutov action --- .github/workflows/4-caching.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 7c3e280..5dd51cb 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -26,7 +26,7 @@ jobs: cache: 'npm' - name: ๐Ÿ“ฅ Download deps โœจwith magic cache ๐Ÿ”ฎ โœจ - uses: bahmutov/npm-install@v1 + uses: bahmutov/npm-install@v1.6 with: useLockFile: false From 741169b5c8c033e6bdd01c1d05a858813709a192 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:05:34 +0200 Subject: [PATCH 23/73] v1.6.0 --- .github/workflows/4-caching.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 5dd51cb..b75648b 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -26,7 +26,7 @@ jobs: cache: 'npm' - name: ๐Ÿ“ฅ Download deps โœจwith magic cache ๐Ÿ”ฎ โœจ - uses: bahmutov/npm-install@v1.6 + uses: bahmutov/npm-install@v1.6.0 with: useLockFile: false From d6cc20afeb2cd09825796e32719b69eede554ad5 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:14:36 +0200 Subject: [PATCH 24/73] with or without cache --- .github/workflows/npm-without-cache.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/npm-without-cache.yml diff --git a/.github/workflows/npm-without-cache.yml b/.github/workflows/npm-without-cache.yml new file mode 100644 index 0000000..2e2d866 --- /dev/null +++ b/.github/workflows/npm-without-cache.yml @@ -0,0 +1,16 @@ +name: Caching with npm +on: push +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: npm install + + - name: Build + run: npm build + + - name: Test + run: npm test \ No newline at end of file From a27531921c1449d2e8b4b94e9410ee7f599ccaa1 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:16:11 +0200 Subject: [PATCH 25/73] run lint for caching --- .github/workflows/npm-cache.yml | 7 ++----- .github/workflows/npm-without-cache.yml | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml index d9c7fce..21291e2 100644 --- a/.github/workflows/npm-cache.yml +++ b/.github/workflows/npm-cache.yml @@ -28,8 +28,5 @@ jobs: - name: Install dependencies run: npm install - - name: Build - run: npm build - - - name: Test - run: npm test \ No newline at end of file + - name: Lint + run: npm run lint \ No newline at end of file diff --git a/.github/workflows/npm-without-cache.yml b/.github/workflows/npm-without-cache.yml index 2e2d866..4a8f5e2 100644 --- a/.github/workflows/npm-without-cache.yml +++ b/.github/workflows/npm-without-cache.yml @@ -9,8 +9,5 @@ jobs: - name: Install dependencies run: npm install - - name: Build - run: npm build - - - name: Test - run: npm test \ No newline at end of file + - name: Lint + run: npm run lint \ No newline at end of file From 535f1f045082a02dc89419c03f033c19adbe59fd Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:20:08 +0200 Subject: [PATCH 26/73] fix me --- .github/workflows/npm-without-cache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npm-without-cache.yml b/.github/workflows/npm-without-cache.yml index 4a8f5e2..f83f49e 100644 --- a/.github/workflows/npm-without-cache.yml +++ b/.github/workflows/npm-without-cache.yml @@ -1,4 +1,4 @@ -name: Caching with npm +name: npm without caching on: push jobs: build: From af5f7ed695efe9e47ff49c76a97ebf0be507ba07 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:22:41 +0200 Subject: [PATCH 27/73] run action only on demo ci branch --- .github/workflows/npm-without-cache.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-without-cache.yml b/.github/workflows/npm-without-cache.yml index f83f49e..2b551b7 100644 --- a/.github/workflows/npm-without-cache.yml +++ b/.github/workflows/npm-without-cache.yml @@ -1,5 +1,10 @@ -name: npm without caching -on: push +name: Without Caching โœจmagicโœจ +on: + push: + branches: + - demo-ci + pull_request: {} + jobs: build: runs-on: ubuntu-latest From b224a67c67a9dbdb0b579f18f7d9cfb843f391f6 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:25:53 +0200 Subject: [PATCH 28/73] cache from doc --- .github/workflows/cache.yml | 24 +++++++++++++++++++ .github/workflows/npm-cache.yml | 32 ------------------------- .github/workflows/npm-without-cache.yml | 18 -------------- 3 files changed, 24 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/cache.yml delete mode 100644 .github/workflows/npm-cache.yml delete mode 100644 .github/workflows/npm-without-cache.yml diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml new file mode 100644 index 0000000..e301331 --- /dev/null +++ b/.github/workflows/cache.yml @@ -0,0 +1,24 @@ +name: Caching Primes + +on: push + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Cache Primes + id: cache-primes + uses: actions/cache@v3 + with: + path: prime-numbers + key: ${{ runner.os }}-primes + + - name: Generate Prime Numbers + if: steps.cache-primes.outputs.cache-hit != 'true' + run: /generate-primes.sh -d prime-numbers + + - name: Use Prime Numbers + run: /primes.sh -d prime-numbers \ No newline at end of file diff --git a/.github/workflows/npm-cache.yml b/.github/workflows/npm-cache.yml deleted file mode 100644 index 21291e2..0000000 --- a/.github/workflows/npm-cache.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Caching with npm -on: push -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} - name: List the state of node modules - continue-on-error: true - run: npm list - - - name: Install dependencies - run: npm install - - - name: Lint - run: npm run lint \ No newline at end of file diff --git a/.github/workflows/npm-without-cache.yml b/.github/workflows/npm-without-cache.yml deleted file mode 100644 index 2b551b7..0000000 --- a/.github/workflows/npm-without-cache.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Without Caching โœจmagicโœจ -on: - push: - branches: - - demo-ci - pull_request: {} - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install dependencies - run: npm install - - - name: Lint - run: npm run lint \ No newline at end of file From 99224c8fdf2ebc220d4a90b1af761436593153a3 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:33:57 +0200 Subject: [PATCH 29/73] cache before test --- .github/workflows/4-caching.yml | 43 ++++----------------------------- .github/workflows/cache.yml | 24 ------------------ 2 files changed, 5 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/cache.yml diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index b75648b..b418e2c 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -13,43 +13,10 @@ jobs: name: โฌฃ ESLint runs-on: ubuntu-latest steps: - - name: ๐Ÿ›‘ Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - - - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v3 - - - name: โŽ” Setup node - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 14 cache: 'npm' - - - name: ๐Ÿ“ฅ Download deps โœจwith magic cache ๐Ÿ”ฎ โœจ - uses: bahmutov/npm-install@v1.6.0 - with: - useLockFile: false - - - name: ๐Ÿ”ฌ Lint - run: npm run lint - - typecheck: - name: สฆ TypeScript - runs-on: ubuntu-latest - steps: - - name: ๐Ÿ›‘ Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - - - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v3 - - - name: โŽ” Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: ๐Ÿ“ฅ Download deps without cache - run: npm install - - - name: ๐Ÿ”Ž Type check - run: npm run typecheck --if-present + - run: npm ci + - run: npm run test \ No newline at end of file diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml deleted file mode 100644 index e301331..0000000 --- a/.github/workflows/cache.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Caching Primes - -on: push - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Cache Primes - id: cache-primes - uses: actions/cache@v3 - with: - path: prime-numbers - key: ${{ runner.os }}-primes - - - name: Generate Prime Numbers - if: steps.cache-primes.outputs.cache-hit != 'true' - run: /generate-primes.sh -d prime-numbers - - - name: Use Prime Numbers - run: /primes.sh -d prime-numbers \ No newline at end of file From 135461403d106fddc93fb27eda72f71802c11745 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:36:44 +0200 Subject: [PATCH 30/73] both scenario in one workflow --- .github/workflows/4-caching.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index b418e2c..4a0c6b8 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -9,8 +9,8 @@ permissions: contents: read jobs: - lint: - name: โฌฃ ESLint + withCache: + name: ๐Ÿช„ With Cache ! runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -19,4 +19,15 @@ jobs: node-version: 14 cache: 'npm' - run: npm ci + - run: npm run test + + withoutCache: + name: ๐Ÿ›‘ Without Cache ! + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 14 + - run: npm ci - run: npm run test \ No newline at end of file From d73a9eb2c9aa46351d5d0ffc6ae46f31b078ea3e Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:37:33 +0200 Subject: [PATCH 31/73] dont use uppercase in job name ? --- .github/workflows/4-caching.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 4a0c6b8..8fed74b 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -9,7 +9,7 @@ permissions: contents: read jobs: - withCache: + withcache: name: ๐Ÿช„ With Cache ! runs-on: ubuntu-latest steps: @@ -21,7 +21,7 @@ jobs: - run: npm ci - run: npm run test - withoutCache: + withoutcache: name: ๐Ÿ›‘ Without Cache ! runs-on: ubuntu-latest steps: From 42762c78b0ed52ab72d3c37bec09da2b0cc9d57e Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:40:40 +0200 Subject: [PATCH 32/73] single runner --- .github/workflows/4-caching.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 8fed74b..65cac27 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -9,7 +9,7 @@ permissions: contents: read jobs: - withcache: + lint: name: ๐Ÿช„ With Cache ! runs-on: ubuntu-latest steps: @@ -19,15 +19,4 @@ jobs: node-version: 14 cache: 'npm' - run: npm ci - - run: npm run test - - withoutcache: - name: ๐Ÿ›‘ Without Cache ! - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 14 - - run: npm ci - run: npm run test \ No newline at end of file From b6599f89607d2e1e6d31195eea132496655adc0c Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:41:06 +0200 Subject: [PATCH 33/73] typecheck --- .github/workflows/4-caching.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 65cac27..c9ca939 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -19,4 +19,27 @@ jobs: node-version: 14 cache: 'npm' - run: npm ci - - run: npm run test \ No newline at end of file + - run: npm run test + + typecheck: + name: สฆ TypeScript + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ๐Ÿ”Ž Type check + run: npm run typecheck --if-present \ No newline at end of file From 501104430c2a629382a6590469b23ddb2d714d8c Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:42:44 +0200 Subject: [PATCH 34/73] lintz --- .github/workflows/4-caching.yml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index c9ca939..da6b93e 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -21,25 +21,15 @@ jobs: - run: npm ci - run: npm run test - typecheck: - name: สฆ TypeScript + lintz: + name: ๐Ÿช„ With Cache ! runs-on: ubuntu-latest steps: - - name: ๐Ÿ›‘ Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - - - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v3 - - - name: โŽ” Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: ๐Ÿ“ฅ Download deps - uses: bahmutov/npm-install@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - useLockFile: false - - - name: ๐Ÿ”Ž Type check - run: npm run typecheck --if-present \ No newline at end of file + node-version: 14 + cache: 'npm' + - run: npm ci + - run: npm run test + \ No newline at end of file From 9676e2dca7d01495493d2fc54b4084b6e14a57d6 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:43:48 +0200 Subject: [PATCH 35/73] =?UTF-8?q?=F0=9F=9B=91without=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/4-caching.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index da6b93e..21a0c94 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -9,7 +9,7 @@ permissions: contents: read jobs: - lint: + withcache: name: ๐Ÿช„ With Cache ! runs-on: ubuntu-latest steps: @@ -21,8 +21,8 @@ jobs: - run: npm ci - run: npm run test - lintz: - name: ๐Ÿช„ With Cache ! + withoutcache: + name: ๐Ÿ›‘ Without Cache ! runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 0632fd27e896951911121c5d58dddd61f75f7bb4 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:44:40 +0200 Subject: [PATCH 36/73] realtime test --- .github/workflows/4-caching.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 21a0c94..0381ce4 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -29,7 +29,6 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 14 - cache: 'npm' - run: npm ci - run: npm run test \ No newline at end of file From 0cb50bc94223e755344a8417a6207b74bc516558 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:49:07 +0200 Subject: [PATCH 37/73] latest caching --- .github/workflows/4-caching.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index 0381ce4..cd00407 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -18,17 +18,16 @@ jobs: with: node-version: 14 cache: 'npm' - - run: npm ci - - run: npm run test - - withoutcache: - name: ๐Ÿ›‘ Without Cache ! - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules with: - node-version: 14 + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + - run: npm ci - run: npm run test \ No newline at end of file From 81a23453e0325fb5ca610729d5a0b5de1611643e Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:50:44 +0200 Subject: [PATCH 38/73] key caching --- .github/workflows/4-caching.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index cd00407..fa449d2 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -18,7 +18,7 @@ jobs: with: node-version: 14 cache: 'npm' - + - name: Cache node modules id: cache-npm uses: actions/cache@v3 @@ -27,6 +27,11 @@ jobs: with: # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - run: npm ci - run: npm run test From a5ea155b1878c0d9a3bfadb65e638ce079c44024 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 05:57:47 +0200 Subject: [PATCH 39/73] save artifact --- .github/workflows/{upload.yml => 5-save_artifact.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{upload.yml => 5-save_artifact.yml} (89%) diff --git a/.github/workflows/upload.yml b/.github/workflows/5-save_artifact.yml similarity index 89% rename from .github/workflows/upload.yml rename to .github/workflows/5-save_artifact.yml index 7154bcb..46fb0ac 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/5-save_artifact.yml @@ -6,9 +6,9 @@ name: upload artifact on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main", "dev", "demo-step1" ] + branches: ["demo-ci" ] pull_request: - branches: [ "main", "dev", "demo-step1" ] + branches: [ "demo-ci" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: From b32200b94247b76432870469740951bb92fe0bff Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:02:49 +0200 Subject: [PATCH 40/73] add status badge ( lint & typecheck) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ceb02fa..9ce44fb 100644 --- a/README.md +++ b/README.md @@ -170,3 +170,6 @@ This project uses ESLint for linting. That is configured in `.eslintrc.js`. ### Formatting We use [Prettier](https://prettier.io/) for auto-formatting in this project. It's recommended to install an editor plugin (like the [VSCode Prettier plugin](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)) to get auto-formatting on save. There's also a `npm run format` script you can run to format all files in the project. + + +[![๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml) \ No newline at end of file From f7bf5449074bf24af80610de93008c59a0505a28 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:03:55 +0200 Subject: [PATCH 41/73] update picture --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ce44fb..49de49f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Remix Indie Stack -![The Remix Indie Stack](https://repository-images.githubusercontent.com/465928257/a241fa49-bd4d-485a-a2a5-5cb8e4ee0abf) +![The Remix Indie Stack](https://florentcmb.github.io/DataWild/logo%20wild.png) Learn more about [Remix Stacks](https://remix.run/stacks). From ed882dac2ec88b7ed4ea15cf5617956b9681687b Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:05:25 +0200 Subject: [PATCH 42/73] update readme picture --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49de49f..f0a24a9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Remix Indie Stack -![The Remix Indie Stack](https://florentcmb.github.io/DataWild/logo%20wild.png) +![The Remix Indie Stack](https://www.wildcodeschool.com/assets/wildcodeschool-logo-meta-image-f6f2f7f52b82bfc419f031f6a989020a8b094d7a4e6676ab6f0dff0b0f470da9.png) Learn more about [Remix Stacks](https://remix.run/stacks). From 8647355b20355daa636b9febe762487e6c95aee3 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:10:03 +0200 Subject: [PATCH 43/73] reorder workflows --- .../workflows/{deploy.yml => 12-deploy.yml} | 0 .../{conditions.yml => 6-conditions.yml} | 6 +-- .../{dependencies.yml => 7-dependencies.yml} | 0 .github/workflows/blank.yml | 48 ------------------- 4 files changed, 3 insertions(+), 51 deletions(-) rename .github/workflows/{deploy.yml => 12-deploy.yml} (100%) rename .github/workflows/{conditions.yml => 6-conditions.yml} (86%) rename .github/workflows/{dependencies.yml => 7-dependencies.yml} (100%) delete mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/12-deploy.yml similarity index 100% rename from .github/workflows/deploy.yml rename to .github/workflows/12-deploy.yml diff --git a/.github/workflows/conditions.yml b/.github/workflows/6-conditions.yml similarity index 86% rename from .github/workflows/conditions.yml rename to .github/workflows/6-conditions.yml index f59886c..eacac43 100644 --- a/.github/workflows/conditions.yml +++ b/.github/workflows/6-conditions.yml @@ -6,9 +6,9 @@ name: conditions on: # Triggers the workflow on push or pull request events but only for the "main" branch push: - branches: [ "main", "dev" ] + branches: [ "demo-ci" ] pull_request: - branches: [ "main", "dev" ] + branches: [ "demo-ci" ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: ๐Ÿš€ Deploy Staging - if: ${{ github.ref == 'refs/heads/dev' }} + if: ${{ github.ref == 'refs/heads/demo-ci' }} run: echo deploying in staging ! - name: ๐Ÿš€ Deploy Production diff --git a/.github/workflows/dependencies.yml b/.github/workflows/7-dependencies.yml similarity index 100% rename from .github/workflows/dependencies.yml rename to .github/workflows/7-dependencies.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml deleted file mode 100644 index 1210dd8..0000000 --- a/.github/workflows/blank.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Blank - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "demo-step1" ] - pull_request: - branches: [ "demo-step1" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - name: ๐Ÿณ Build me (Wild School Session) - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. - - # Runs a test workflow - - name: Run markdown lint - run: | - npm install remark-cli remark-preset-lint-consistent - npx remark . --use remark-preset-lint-consistent --frail - - - uses: actions/upload-artifact@main - with: - name: remark-lint-report - path: public/ From fd05a9ac69c76e9d18cdbdd584e2832b0ba241df Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:14:30 +0200 Subject: [PATCH 44/73] add emoji's --- .github/workflows/5-save_artifact.yml | 2 +- .github/workflows/6-conditions.yml | 2 +- .github/workflows/7-dependencies.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/5-save_artifact.yml b/.github/workflows/5-save_artifact.yml index 46fb0ac..2d2114e 100644 --- a/.github/workflows/5-save_artifact.yml +++ b/.github/workflows/5-save_artifact.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: upload artifact +name: ๐Ÿ’พ Save artifacts # Controls when the workflow will run on: diff --git a/.github/workflows/6-conditions.yml b/.github/workflows/6-conditions.yml index eacac43..5a170cd 100644 --- a/.github/workflows/6-conditions.yml +++ b/.github/workflows/6-conditions.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: conditions +name: ๐ŸŽŒ conditions # Controls when the workflow will run on: diff --git a/.github/workflows/7-dependencies.yml b/.github/workflows/7-dependencies.yml index f955087..add35fc 100644 --- a/.github/workflows/7-dependencies.yml +++ b/.github/workflows/7-dependencies.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: dependencies +name: ๐Ÿงฒ dependencies # Controls when the workflow will run on: From e087764994388585bf5cde40bd073ce8eaf8fb86 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:16:08 +0200 Subject: [PATCH 45/73] rename workflows --- .github/workflows/1-setup_automated_build.yml | 2 +- .github/workflows/2-multi_os.yml | 2 +- .github/workflows/3-Linting_Typecheck.yml | 2 +- .github/workflows/4-caching.yml | 2 +- .github/workflows/5-save_artifact.yml | 2 +- .github/workflows/6-conditions.yml | 2 +- .github/workflows/7-dependencies.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/1-setup_automated_build.yml b/.github/workflows/1-setup_automated_build.yml index 0226f8e..68d696b 100644 --- a/.github/workflows/1-setup_automated_build.yml +++ b/.github/workflows/1-setup_automated_build.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: ๐Ÿ”Ž Get Started +name: 1- ๐Ÿ”Ž Get Started # Controls when the workflow will run on: diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml index f7e046d..57af00b 100644 --- a/.github/workflows/2-multi_os.yml +++ b/.github/workflows/2-multi_os.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions # and how use multi OS & Versions -name: ๐Ÿฆ‘ Multi OS & Versions +name: 2- ๐Ÿฆ‘ Multi OS & Versions # Controls when the workflow will run on: diff --git a/.github/workflows/3-Linting_Typecheck.yml b/.github/workflows/3-Linting_Typecheck.yml index 8fb51a4..50a60b7 100644 --- a/.github/workflows/3-Linting_Typecheck.yml +++ b/.github/workflows/3-Linting_Typecheck.yml @@ -1,4 +1,4 @@ -name: ๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž +name: 3- ๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž on: push: branches: diff --git a/.github/workflows/4-caching.yml b/.github/workflows/4-caching.yml index fa449d2..445cd7a 100644 --- a/.github/workflows/4-caching.yml +++ b/.github/workflows/4-caching.yml @@ -1,4 +1,4 @@ -name: ๐Ÿช„ Caching โœจmagicโœจ +name: 4- ๐Ÿช„ Caching โœจmagicโœจ on: push: branches: diff --git a/.github/workflows/5-save_artifact.yml b/.github/workflows/5-save_artifact.yml index 2d2114e..e1a9e9b 100644 --- a/.github/workflows/5-save_artifact.yml +++ b/.github/workflows/5-save_artifact.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: ๐Ÿ’พ Save artifacts +name: 5- ๐Ÿ’พ Save artifacts # Controls when the workflow will run on: diff --git a/.github/workflows/6-conditions.yml b/.github/workflows/6-conditions.yml index 5a170cd..3bf254f 100644 --- a/.github/workflows/6-conditions.yml +++ b/.github/workflows/6-conditions.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: ๐ŸŽŒ conditions +name: 6- ๐ŸŽŒ conditions # Controls when the workflow will run on: diff --git a/.github/workflows/7-dependencies.yml b/.github/workflows/7-dependencies.yml index add35fc..1937df8 100644 --- a/.github/workflows/7-dependencies.yml +++ b/.github/workflows/7-dependencies.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: ๐Ÿงฒ dependencies +name: 7- ๐Ÿงฒ dependencies # Controls when the workflow will run on: From 550a3f8c1b36387998fc4ff9e52b186074ce0832 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:22:51 +0200 Subject: [PATCH 46/73] unit & e2e test --- .github/workflows/8-unit_test.yml | 33 ++++++++++++++++++++++ .github/workflows/9-E2E_test.yml | 47 +++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/8-unit_test.yml create mode 100644 .github/workflows/9-E2E_test.yml diff --git a/.github/workflows/8-unit_test.yml b/.github/workflows/8-unit_test.yml new file mode 100644 index 0000000..8d27b54 --- /dev/null +++ b/.github/workflows/8-unit_test.yml @@ -0,0 +1,33 @@ +name: 8-๐ŸŒก๏ธ Unit Test +on: + push: + branches: + - demo-ci + pull_request: {} +permissions: + actions: write + contents: read + +jobs: + vitest: + name: โšก Vitest + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: โšก Run vitest + run: npm run test -- --coverage \ No newline at end of file diff --git a/.github/workflows/9-E2E_test.yml b/.github/workflows/9-E2E_test.yml new file mode 100644 index 0000000..c88c8f9 --- /dev/null +++ b/.github/workflows/9-E2E_test.yml @@ -0,0 +1,47 @@ +name: 9-โšซ๏ธ E2E Test +on: + push: + branches: + - demo-ci + pull_request: {} +permissions: + actions: write + contents: read + +jobs: + cypress: + name: โšซ๏ธ Cypress + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: ๐Ÿ„ Copy test env vars + run: cp .env.example .env + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ๐Ÿ›  Setup Database + run: npx prisma migrate reset --force + + - name: โš™๏ธ Build + run: npm run build + + - name: ๐ŸŒณ Cypress run + uses: cypress-io/github-action@v4 + with: + start: npm run start:mocks + wait-on: "http://localhost:8811" + env: + PORT: "8811" From 62290232d564d2b95c2536e431a1018af37c7d08 Mon Sep 17 00:00:00 2001 From: Akir Oussama Date: Thu, 16 Jun 2022 06:28:45 +0200 Subject: [PATCH 47/73] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f0a24a9..ba6eef7 100644 --- a/README.md +++ b/README.md @@ -172,4 +172,6 @@ This project uses ESLint for linting. That is configured in `.eslintrc.js`. We use [Prettier](https://prettier.io/) for auto-formatting in this project. It's recommended to install an editor plugin (like the [VSCode Prettier plugin](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)) to get auto-formatting on save. There's also a `npm run format` script you can run to format all files in the project. -[![๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml) \ No newline at end of file +[![๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml) + +[![9-โšซ๏ธ E2E Test](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/9-E2E_test.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/9-E2E_test.yml) From 602b476921d8d8fb81db66c3abe57a3fbba4091e Mon Sep 17 00:00:00 2001 From: Akir Oussama Date: Thu, 16 Jun 2022 06:29:06 +0200 Subject: [PATCH 48/73] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba6eef7..257a1cf 100644 --- a/README.md +++ b/README.md @@ -174,4 +174,4 @@ We use [Prettier](https://prettier.io/) for auto-formatting in this project. It' [![๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml) -[![9-โšซ๏ธ E2E Test](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/9-E2E_test.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/9-E2E_test.yml) + From dbf70dae2573ed798c47b7e3ddaed585431da69f Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:34:16 +0200 Subject: [PATCH 49/73] formatter --- .github/workflows/10-prettier.yml | 34 +++++++++++++++++++++++++++++++ app/root.tsx | 3 +++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/10-prettier.yml diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml new file mode 100644 index 0000000..a3953cb --- /dev/null +++ b/.github/workflows/10-prettier.yml @@ -0,0 +1,34 @@ +name: 10- ๐Ÿ’„ Prettier & Formatting code +on: + push: + branches: + - demo-ci + pull_request: {} +permissions: + actions: write + contents: read + +jobs: + lint: + name: ๐Ÿ’„ Prettier + runs-on: ubuntu-latest + steps: + - name: ๐Ÿ›‘ Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.1 + + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v3 + + - name: โŽ” Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: ๐Ÿ“ฅ Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ๐Ÿ’„ Prettier + run: npm run format + diff --git a/app/root.tsx b/app/root.tsx index 1f4523b..989e2bb 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -17,6 +17,9 @@ import tailwindStylesheetUrl from "./styles/tailwind.css"; import { getUser } from "./session.server"; // uncomment me to provoke eslint error for demo purposes // import { getUserFromSession } from "./session.server"; +const badFormat = { + name: 'badFormat', +}; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: tailwindStylesheetUrl }]; From efadf347a7ddddda35775be234555d70f2ff2cf4 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:37:45 +0200 Subject: [PATCH 50/73] commit prettier fix --- .github/workflows/10-prettier.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index a3953cb..341edd4 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -4,9 +4,7 @@ on: branches: - demo-ci pull_request: {} -permissions: - actions: write - contents: read +permissions: read-all|write-all jobs: lint: @@ -32,3 +30,10 @@ jobs: - name: ๐Ÿ’„ Prettier run: npm run format + - name: commit + run: | + # Stage the file, commit and push + git add . + git commit -m "fix format" + git push origin demo-ci + From 7c09d7e47e187ab62ef691196f40279b011e859f Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:41:47 +0200 Subject: [PATCH 51/73] format & commit --- .github/workflows/10-prettier.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index 341edd4..c2ef897 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -4,7 +4,8 @@ on: branches: - demo-ci pull_request: {} -permissions: read-all|write-all + permissions: + actions: read-all|write-all jobs: lint: From 744f3965eaac6cae42d20c57af890f2aff7368cd Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:43:08 +0200 Subject: [PATCH 52/73] actions: read-all|write-all --- .github/workflows/10-prettier.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index c2ef897..f733700 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -4,8 +4,8 @@ on: branches: - demo-ci pull_request: {} - permissions: - actions: read-all|write-all +permissions: + actions: read-all|write-all jobs: lint: From d06a450ffe2dca3602a265f28499f49bc0b03d7c Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:44:28 +0200 Subject: [PATCH 53/73] read write --- .github/workflows/10-prettier.yml | 2 +- app/root.tsx | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index f733700..a6e149c 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -5,7 +5,7 @@ on: - demo-ci pull_request: {} permissions: - actions: read-all|write-all + actions: read|write jobs: lint: diff --git a/app/root.tsx b/app/root.tsx index 989e2bb..1f4523b 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -17,9 +17,6 @@ import tailwindStylesheetUrl from "./styles/tailwind.css"; import { getUser } from "./session.server"; // uncomment me to provoke eslint error for demo purposes // import { getUserFromSession } from "./session.server"; -const badFormat = { - name: 'badFormat', -}; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: tailwindStylesheetUrl }]; From da635ef4c5dfdd865730a8968d5efc5b3bbd349a Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:45:22 +0200 Subject: [PATCH 54/73] write --- .github/workflows/10-prettier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index a6e149c..1abd22b 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -5,7 +5,7 @@ on: - demo-ci pull_request: {} permissions: - actions: read|write + actions: write jobs: lint: From 27c2b4f627e864f8819a4e46d5bfe20557fa1978 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:49:22 +0200 Subject: [PATCH 55/73] commit using ready action --- .github/workflows/10-prettier.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index 1abd22b..aff34b5 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -31,10 +31,9 @@ jobs: - name: ๐Ÿ’„ Prettier run: npm run format - - name: commit - run: | - # Stage the file, commit and push - git add . - git commit -m "fix format" - git push origin demo-ci + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "fix format!" + commit_user_name: akiroussama + commit_user_email: akir.oussama@gmail.com From 849e60db4bc76d3bbddb120246b2d197f20fcaad Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:50:45 +0200 Subject: [PATCH 56/73] indentation --- .github/workflows/10-prettier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index aff34b5..0ba9475 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -31,7 +31,7 @@ jobs: - name: ๐Ÿ’„ Prettier run: npm run format - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: "fix format!" commit_user_name: akiroussama From e742bd08810e584a7bfb3830abdfd5534e2dbdbb Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:53:29 +0200 Subject: [PATCH 57/73] add branch config --- .github/workflows/10-prettier.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/10-prettier.yml b/.github/workflows/10-prettier.yml index 0ba9475..3d5ddb4 100644 --- a/.github/workflows/10-prettier.yml +++ b/.github/workflows/10-prettier.yml @@ -36,4 +36,5 @@ jobs: commit_message: "fix format!" commit_user_name: akiroussama commit_user_email: akir.oussama@gmail.com + branch: demo-ci From e95a4b12c518fd00041d6d48d355639a049cd849 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 06:59:58 +0200 Subject: [PATCH 58/73] add labeler trigger --- .github/labeler-trigger.yml | 14 ++++++++++++++ .github/workflows/11-pull_request_labeler.yml | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .github/labeler-trigger.yml create mode 100644 .github/workflows/11-pull_request_labeler.yml diff --git a/.github/labeler-trigger.yml b/.github/labeler-trigger.yml new file mode 100644 index 0000000..890e062 --- /dev/null +++ b/.github/labeler-trigger.yml @@ -0,0 +1,14 @@ +review me: +- "*" + +bug: +- "**" + +# Add 'test' label to any change to *.spec.js files within the source dir +test: +- src/**/*.spec.js + +# Add 'frontend` label to any change to *.js files as long as the `main.js` hasn't changed +frontend: +- any: ['src/**/*.js'] + all: ['!src/main.js'] \ No newline at end of file diff --git a/.github/workflows/11-pull_request_labeler.yml b/.github/workflows/11-pull_request_labeler.yml new file mode 100644 index 0000000..053227c --- /dev/null +++ b/.github/workflows/11-pull_request_labeler.yml @@ -0,0 +1,15 @@ +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + triage: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler-trigger.yml \ No newline at end of file From 2c1ed7f4b5f76d785d06c9a50073ccc408cb681e Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:04:33 +0200 Subject: [PATCH 59/73] je triche (on push) --- .github/workflows/11-pull_request_labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/11-pull_request_labeler.yml b/.github/workflows/11-pull_request_labeler.yml index 053227c..cc1b75f 100644 --- a/.github/workflows/11-pull_request_labeler.yml +++ b/.github/workflows/11-pull_request_labeler.yml @@ -1,6 +1,6 @@ name: "Pull Request Labeler" on: -- pull_request_target +- push jobs: triage: From 5562e7eafd274f72361a70bfe17ee8835bf9874e Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:06:58 +0200 Subject: [PATCH 60/73] demo_ci branch only --- .github/{labeler-trigger.yml => labeler.yml} | 0 .../{11-pull_request_labeler.yml => 11-labeler.yml} | 7 +++++-- 2 files changed, 5 insertions(+), 2 deletions(-) rename .github/{labeler-trigger.yml => labeler.yml} (100%) rename .github/workflows/{11-pull_request_labeler.yml => 11-labeler.yml} (70%) diff --git a/.github/labeler-trigger.yml b/.github/labeler.yml similarity index 100% rename from .github/labeler-trigger.yml rename to .github/labeler.yml diff --git a/.github/workflows/11-pull_request_labeler.yml b/.github/workflows/11-labeler.yml similarity index 70% rename from .github/workflows/11-pull_request_labeler.yml rename to .github/workflows/11-labeler.yml index cc1b75f..d756cfd 100644 --- a/.github/workflows/11-pull_request_labeler.yml +++ b/.github/workflows/11-labeler.yml @@ -1,6 +1,9 @@ name: "Pull Request Labeler" on: -- push + push: + branches: + - demo-ci + pull_request: {} jobs: triage: @@ -12,4 +15,4 @@ jobs: - uses: actions/labeler@v4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler-trigger.yml \ No newline at end of file + configuration-path: .github/labeler.yml \ No newline at end of file From 1fcaf9c6016f8d8557e0ca6f43a840874c3f71b0 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:08:10 +0200 Subject: [PATCH 61/73] should this trigger a label ? I hope --- app/root.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/root.tsx b/app/root.tsx index 1f4523b..11c75ce 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -22,6 +22,7 @@ export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: tailwindStylesheetUrl }]; }; +//this is just a comment! export const meta: MetaFunction = () => ({ charset: "utf-8", title: "WS Notes", From a0d17e23c2fe0d0ca1402945dc2bfbb9e98a4606 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:11:53 +0200 Subject: [PATCH 62/73] decathlon labeler --- .github/labeler.yml | 24 ++++++++++-------------- .github/workflows/11-labeler.yml | 30 ++++++++++++++---------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 890e062..89bfecf 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,14 +1,10 @@ -review me: -- "*" - -bug: -- "**" - -# Add 'test' label to any change to *.spec.js files within the source dir -test: -- src/**/*.spec.js - -# Add 'frontend` label to any change to *.js files as long as the `main.js` hasn't changed -frontend: -- any: ['src/**/*.js'] - all: ['!src/main.js'] \ No newline at end of file +- regExp: ".*\\.ts+$" + labels: ["typescript"] +- regExp: ".*\\.sql+$" + labels: ["database", "critical"] +- regExp: ".*\\.md+$" + labels: ["documentation"] +- regExp: "^(pom\\.xml|package\\.json|build\\.gradle)$" + labels: ["dependencies"] +- regExp: ".*\\.(zip|jar|war|ear)+$" + labels: ["artifact", "invalid"] \ No newline at end of file diff --git a/.github/workflows/11-labeler.yml b/.github/workflows/11-labeler.yml index d756cfd..d75875f 100644 --- a/.github/workflows/11-labeler.yml +++ b/.github/workflows/11-labeler.yml @@ -1,18 +1,16 @@ -name: "Pull Request Labeler" -on: - push: - branches: - - demo-ci - pull_request: {} - +# Workflow to associate labels automatically +name: 11 - labeler +# Trigger the workflow on pull request events +on: [pull_request] jobs: - triage: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest + label: + runs-on: ubuntu-18.04 steps: - - uses: actions/labeler@v4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml \ No newline at end of file + # We need to checkout the repository to access the configured file (.github/label-pr.yml) + - uses: actions/checkout@v2 + - name: Labeler + uses: docker://decathlon/pull-request-labeler-action:2.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Here we can override the path for the action configuration. If none is provided, default one is `.github/label-pr.yml` + CONFIG_PATH: ${{ secrets.GITHUB_WORKSPACE }}/.github/label-pr.yml \ No newline at end of file From 00afd4887d2ef8f022ebe2760b735f2b14c3f54e Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:13:43 +0200 Subject: [PATCH 63/73] label-pr --- .github/{labeler.yml => label-pr.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{labeler.yml => label-pr.yml} (100%) diff --git a/.github/labeler.yml b/.github/label-pr.yml similarity index 100% rename from .github/labeler.yml rename to .github/label-pr.yml From 6b87b5bd593a9fb5fdec47295fe2ae19789f4a32 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:18:26 +0200 Subject: [PATCH 64/73] =?UTF-8?q?13-=20=F0=9F=94=96labeler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/11-labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/11-labeler.yml b/.github/workflows/11-labeler.yml index d75875f..28d1652 100644 --- a/.github/workflows/11-labeler.yml +++ b/.github/workflows/11-labeler.yml @@ -1,5 +1,5 @@ # Workflow to associate labels automatically -name: 11 - labeler +name: 13- ๐Ÿ”–labeler # Trigger the workflow on pull request events on: [pull_request] jobs: From 5d3959d7c043dbfdadf4613010c764810666f22e Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:21:21 +0200 Subject: [PATCH 65/73] create release --- .../{11-labeler.yml => 13-labeler.yml} | 0 .github/workflows/14-create-release.yml | 29 +++++++++++++++++++ .../{12-deploy.yml => 15-deploy.yml} | 0 3 files changed, 29 insertions(+) rename .github/workflows/{11-labeler.yml => 13-labeler.yml} (100%) create mode 100644 .github/workflows/14-create-release.yml rename .github/workflows/{12-deploy.yml => 15-deploy.yml} (100%) diff --git a/.github/workflows/11-labeler.yml b/.github/workflows/13-labeler.yml similarity index 100% rename from .github/workflows/11-labeler.yml rename to .github/workflows/13-labeler.yml diff --git a/.github/workflows/14-create-release.yml b/.github/workflows/14-create-release.yml new file mode 100644 index 0000000..1fbe29e --- /dev/null +++ b/.github/workflows/14-create-release.yml @@ -0,0 +1,29 @@ +name: 13- ๐ŸšขCreate Release +on: + push: + branches: + - release + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Changes in this Release + - First Change + - Second Change + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/12-deploy.yml b/.github/workflows/15-deploy.yml similarity index 100% rename from .github/workflows/12-deploy.yml rename to .github/workflows/15-deploy.yml From 0870d85cd9c3650f6ee68463734f2e629366db82 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:25:32 +0200 Subject: [PATCH 66/73] create release --- .github/workflows/14-create-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/14-create-release.yml b/.github/workflows/14-create-release.yml index 1fbe29e..a004aa8 100644 --- a/.github/workflows/14-create-release.yml +++ b/.github/workflows/14-create-release.yml @@ -4,8 +4,6 @@ on: branches: - release -name: Create Release - jobs: build: name: Create Release From cc0e3ee881eae39c0d4a3f0347742e79f59bd2be Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:27:47 +0200 Subject: [PATCH 67/73] deploy --- .github/workflows/15-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/15-deploy.yml b/.github/workflows/15-deploy.yml index 4128983..6324b47 100644 --- a/.github/workflows/15-deploy.yml +++ b/.github/workflows/15-deploy.yml @@ -4,6 +4,7 @@ on: branches: - main - dev + - demo-ci pull_request: {} permissions: actions: write From fcbe10b171b7d870c3714e4c3e06dfa3ab2b7854 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:31:18 +0200 Subject: [PATCH 68/73] auto approve PR --- .../workflows/16-auto_approve_pull_request.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/16-auto_approve_pull_request.yml diff --git a/.github/workflows/16-auto_approve_pull_request.yml b/.github/workflows/16-auto_approve_pull_request.yml new file mode 100644 index 0000000..6f1b5fb --- /dev/null +++ b/.github/workflows/16-auto_approve_pull_request.yml @@ -0,0 +1,15 @@ +name: 16- ๐Ÿ”ฅAuto approve PR + +on: + pull_request + +jobs: + auto-approve: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: hmarr/auto-approve-action@v2 + if: github.actor == 'akir.oussama' + with: + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From f3e2b2116c39207ccf6e2f80aa0da764e00b6002 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:33:19 +0200 Subject: [PATCH 69/73] update actor --- .github/workflows/16-auto_approve_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/16-auto_approve_pull_request.yml b/.github/workflows/16-auto_approve_pull_request.yml index 6f1b5fb..8d0def2 100644 --- a/.github/workflows/16-auto_approve_pull_request.yml +++ b/.github/workflows/16-auto_approve_pull_request.yml @@ -10,6 +10,6 @@ jobs: pull-requests: write steps: - uses: hmarr/auto-approve-action@v2 - if: github.actor == 'akir.oussama' + if: github.actor == 'akiroussama' with: github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 0671c158e18a2b6e281cc7b136fe29009cbd45ab Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 07:36:46 +0200 Subject: [PATCH 70/73] add demo ci --- .github/workflows/15-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/15-deploy.yml b/.github/workflows/15-deploy.yml index 6324b47..8f5ff61 100644 --- a/.github/workflows/15-deploy.yml +++ b/.github/workflows/15-deploy.yml @@ -120,7 +120,7 @@ jobs: build: name: ๐Ÿณ Build # only build/deploy main branch on pushes - if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} + if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/demo-ci') && github.event_name == 'push' }} runs-on: ubuntu-latest steps: - name: ๐Ÿ›‘ Cancel Previous Runs @@ -181,7 +181,7 @@ jobs: runs-on: ubuntu-latest needs: [lint, typecheck, vitest, cypress, build] # only build/deploy main branch on pushes - if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }} + if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/demo-ci') && github.event_name == 'push' }} steps: - name: ๐Ÿ›‘ Cancel Previous Runs From 03969d42b2ffd4efe9386ba50c09fd907102abb5 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 10:09:09 +0200 Subject: [PATCH 71/73] fix error --- .github/workflows/2-multi_os.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/2-multi_os.yml b/.github/workflows/2-multi_os.yml index 57af00b..8e0d093 100644 --- a/.github/workflows/2-multi_os.yml +++ b/.github/workflows/2-multi_os.yml @@ -44,4 +44,4 @@ jobs: #error, should use -v - name: ๐Ÿ”– Read node version - run: node --v \ No newline at end of file + run: node -v \ No newline at end of file From 74a388f60792a8229eaa6ce3837209488f647136 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 10:15:13 +0200 Subject: [PATCH 72/73] provoke error --- app/root.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/root.tsx b/app/root.tsx index 11c75ce..3156451 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -16,7 +16,7 @@ import { import tailwindStylesheetUrl from "./styles/tailwind.css"; import { getUser } from "./session.server"; // uncomment me to provoke eslint error for demo purposes -// import { getUserFromSession } from "./session.server"; +import { getUserFromSession } from "./session.server"; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: tailwindStylesheetUrl }]; From 47fe175911fdacd7263ff8bb084482f0bfddf0d2 Mon Sep 17 00:00:00 2001 From: oakir Date: Thu, 16 Jun 2022 10:35:42 +0200 Subject: [PATCH 73/73] add E2E test badge --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 257a1cf..c1d3d4b 100644 --- a/README.md +++ b/README.md @@ -175,3 +175,7 @@ We use [Prettier](https://prettier.io/) for auto-formatting in this project. It' [![๐Ÿ”ฌ Linting & TypeCheck ๐Ÿ”Ž](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/3-Linting_Typecheck.yml) + + +[![9-โšซ๏ธ E2E Test](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/9-E2E_test.yml/badge.svg?branch=demo-ci)](https://github.com/akiroussama/ci-example-using-github-actions/actions/workflows/9-E2E_test.yml) +