Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e627efd
setup auto build
oakir Jun 16, 2022
bd1bd63
add yml extension
oakir Jun 16, 2022
f4ee78b
multi versions & os
oakir Jun 16, 2022
4acbae2
use demo-ci branch
oakir Jun 16, 2022
9f0da4b
improve look & feel
oakir Jun 16, 2022
137756d
add comment
oakir Jun 16, 2022
a623157
test fix
oakir Jun 16, 2022
003babb
add error to fail build
oakir Jun 16, 2022
79176e6
linting & typescheck
oakir Jun 16, 2022
e09238e
test lint
oakir Jun 16, 2022
f6e6c48
provoke eslint error
oakir Jun 16, 2022
baf35eb
eslint error
oakir Jun 16, 2022
2477e44
remove debugger;
oakir Jun 16, 2022
060b045
add caching ( before )
oakir Jun 16, 2022
e03b2b7
enable caching
oakir Jun 16, 2022
663db07
now cache should work
oakir Jun 16, 2022
7934ed0
npm caching
oakir Jun 16, 2022
c3f6249
fix push syntax
oakir Jun 16, 2022
a57fa36
run lint for test cache
oakir Jun 16, 2022
2e3e868
another try for caching
oakir Jun 16, 2022
d8d8f16
use bahmutov action for cache
oakir Jun 16, 2022
09c3825
use 1.6 version of bahmutov action
oakir Jun 16, 2022
741169b
v1.6.0
oakir Jun 16, 2022
d6cc20a
with or without cache
oakir Jun 16, 2022
a275319
run lint for caching
oakir Jun 16, 2022
535f1f0
fix me
oakir Jun 16, 2022
af5f7ed
run action only on demo ci branch
oakir Jun 16, 2022
b224a67
cache from doc
oakir Jun 16, 2022
99224c8
cache before test
oakir Jun 16, 2022
1354614
both scenario in one workflow
oakir Jun 16, 2022
d73a9eb
dont use uppercase in job name ?
oakir Jun 16, 2022
42762c7
single runner
oakir Jun 16, 2022
b6599f8
typecheck
oakir Jun 16, 2022
5011044
lintz
oakir Jun 16, 2022
9676e2d
🛑without cache
oakir Jun 16, 2022
0632fd2
realtime test
oakir Jun 16, 2022
0cb50bc
latest caching
oakir Jun 16, 2022
81a2345
key caching
oakir Jun 16, 2022
a5ea155
save artifact
oakir Jun 16, 2022
b32200b
add status badge ( lint & typecheck)
oakir Jun 16, 2022
f7bf544
update picture
oakir Jun 16, 2022
ed882da
update readme picture
oakir Jun 16, 2022
8647355
reorder workflows
oakir Jun 16, 2022
fd05a9a
add emoji's
oakir Jun 16, 2022
e087764
rename workflows
oakir Jun 16, 2022
550a3f8
unit & e2e test
oakir Jun 16, 2022
6229023
Update README.md
akiroussama Jun 16, 2022
602b476
Update README.md
akiroussama Jun 16, 2022
dbf70da
formatter
oakir Jun 16, 2022
7a576ce
Merge branch 'demo-ci' of https://github.com/akiroussama/ci-example-u…
oakir Jun 16, 2022
efadf34
commit prettier fix
oakir Jun 16, 2022
7c09d7e
format & commit
oakir Jun 16, 2022
744f396
actions: read-all|write-all
oakir Jun 16, 2022
d06a450
read write
oakir Jun 16, 2022
da635ef
write
oakir Jun 16, 2022
27c2b4f
commit using ready action
oakir Jun 16, 2022
849e60d
indentation
oakir Jun 16, 2022
e742bd0
add branch config
oakir Jun 16, 2022
e95a4b1
add labeler trigger
oakir Jun 16, 2022
2c1ed7f
je triche (on push)
oakir Jun 16, 2022
5562e7e
demo_ci branch only
oakir Jun 16, 2022
1fcaf9c
should this trigger a label ? I hope
oakir Jun 16, 2022
a0d17e2
decathlon labeler
oakir Jun 16, 2022
00afd48
label-pr
oakir Jun 16, 2022
6b87b5b
13- 🔖labeler
oakir Jun 16, 2022
5d3959d
create release
oakir Jun 16, 2022
0870d85
create release
oakir Jun 16, 2022
cc0e3ee
deploy
oakir Jun 16, 2022
fcbe10b
auto approve PR
oakir Jun 16, 2022
f3e2b21
update actor
oakir Jun 16, 2022
0671c15
add demo ci
oakir Jun 16, 2022
03969d4
fix error
oakir Jun 16, 2022
74a388f
provoke error
oakir Jun 16, 2022
47fe175
add E2E test badge
oakir Jun 16, 2022
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
10 changes: 10 additions & 0 deletions .github/label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- 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"]
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
# This is a basic workflow to help you get started with Actions

name: Blank
name: 1- 🔎 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-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:

# 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)
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
- uses: actions/checkout@v3
- name: ⬇️ Checkout repo
uses: actions/checkout@v3

# Runs a single command using the runners shell
- name: Run a one-line script
- 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
- 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/
40 changes: 40 additions & 0 deletions .github/workflows/10-prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 10- 💄 Prettier & Formatting code
on:
push:
branches:
- demo-ci
pull_request: {}
permissions:
actions: write

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

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "fix format!"
commit_user_name: akiroussama
commit_user_email: akir.oussama@gmail.com
branch: demo-ci

16 changes: 16 additions & 0 deletions .github/workflows/13-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Workflow to associate labels automatically
name: 13- 🔖labeler
# Trigger the workflow on pull request events
on: [pull_request]
jobs:
label:
runs-on: ubuntu-18.04
steps:
# 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
27 changes: 27 additions & 0 deletions .github/workflows/14-create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 13- 🚢Create Release
on:
push:
branches:
- 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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
- dev
- demo-ci
pull_request: {}
permissions:
actions: write
Expand Down Expand Up @@ -119,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
Expand Down Expand Up @@ -180,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
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/16-auto_approve_pull_request.yml
Original file line number Diff line number Diff line change
@@ -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 == 'akiroussama'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 18 additions & 8 deletions .github/workflows/multiOs.yml → .github/workflows/2-multi_os.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This is a basic workflow to help you get started with Actions

name: Multi Versions
# and how use multi OS & Versions
name: 2- 🦑 Multi OS & 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" ]
branches: [ "demo-ci" ]
pull_request:
branches: [ "demo-step1" ]
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:
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
Expand All @@ -27,11 +27,21 @@ jobs:
- os: windows-latest
node: 16
npm: 6

runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v3
- name: ⚙️ Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- if: ${{ matrix.npm }}

- name: 🔧 only install on windows & node version is 16
if: ${{ matrix.npm }}
run: npm install -g npm@${{ matrix.npm }}
- run: npm --version

- name: 👀 Read npm version
run: npm --version

#error, should use -v
- name: 🔖 Read node version
run: node -v
56 changes: 56 additions & 0 deletions .github/workflows/3-Linting_Typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 3- 🔬 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
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
38 changes: 38 additions & 0 deletions .github/workflows/4-caching.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 4- 🪄 Caching ✨magic✨
on:
push:
branches:
- demo-ci
pull_request: {}
permissions:
actions: write
contents: read

jobs:
withcache:
name: 🪄 With Cache !
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
cache: 'npm'

- 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 }}-

- run: npm ci
- run: npm run test

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This is a basic workflow to help you get started with Actions

name: upload artifact
name: 5- 💾 Save artifacts

# Controls when the workflow will run
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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This is a basic workflow to help you get started with Actions

name: conditions
name: 6- 🎌 conditions

# Controls when the workflow will run
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:
Expand All @@ -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
Expand Down
Loading