Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new branch check pr #229

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a78c3d4
Add work-flow
alejandrocabriales Sep 28, 2024
72aa199
Add the date and the directory
alejandrocabriales Sep 28, 2024
bce840c
add lint
alejandrocabriales Sep 29, 2024
751c050
fix the errors
alejandrocabriales Sep 29, 2024
1b69ca9
fix the errors
alejandrocabriales Sep 29, 2024
27493e1
TRY TO FIGURE OUT THE ERROR
alejandrocabriales Sep 29, 2024
63652e5
change to double quotes
alejandrocabriales Sep 29, 2024
4a0ddac
fix the quotes
alejandrocabriales Sep 29, 2024
2243ad3
change the quotes
alejandrocabriales Sep 29, 2024
22046a3
remove simple quotes
alejandrocabriales Sep 29, 2024
2d8b367
fix unnecessary var
alejandrocabriales Sep 29, 2024
ad972db
try to fix trailing spaces not allowed
alejandrocabriales Sep 29, 2024
a46a4e3
add the build and test
alejandrocabriales Sep 29, 2024
3a3382f
fix the error in the code
alejandrocabriales Sep 29, 2024
de53440
add playright
alejandrocabriales Sep 29, 2024
de789f4
add workflow playright
alejandrocabriales Sep 29, 2024
8ef3a19
change the time
alejandrocabriales Sep 29, 2024
af162bc
change the port
alejandrocabriales Sep 29, 2024
6747ff8
fix the ports
alejandrocabriales Sep 29, 2024
e8e4ebe
Check the code in pr
alejandrocabriales Sep 30, 2024
efb9769
Only allows to deploy when merge master
alejandrocabriales Sep 30, 2024
6ed014a
Exercises 11.15-11.16.
alejandrocabriales Oct 1, 2024
2e1b97f
Change to double quotes
alejandrocabriales Oct 1, 2024
4feee5e
Remove error in playwright.config
alejandrocabriales Oct 1, 2024
cb33e60
fix the playwringht file
alejandrocabriales Oct 1, 2024
055e488
remove extra semicolon
alejandrocabriales Oct 1, 2024
f46e755
fix error
alejandrocabriales Oct 1, 2024
da8b2bf
fix error
alejandrocabriales Oct 1, 2024
77e31f4
remove the sapce
alejandrocabriales Oct 1, 2024
e896a4b
Fix the test
alejandrocabriales Oct 1, 2024
5639649
try to fix
alejandrocabriales Oct 1, 2024
ba952bf
fix error in the app
alejandrocabriales Oct 1, 2024
a606698
Fix
alejandrocabriales Oct 1, 2024
d0fbbbe
change dots
alejandrocabriales Oct 1, 2024
da111b7
update the versions of package
alejandrocabriales Oct 1, 2024
621fd39
add the test_job
alejandrocabriales Oct 1, 2024
55fa973
11.16 Skipping a commit for tagging and deployment
alejandrocabriales Oct 4, 2024
5a22579
Exercise 11.18
alejandrocabriales Oct 11, 2024
507b401
Fix the error node version
alejandrocabriales Oct 11, 2024
f75e553
Add node version in test
alejandrocabriales Oct 11, 2024
cd11c09
Fix the error
alejandrocabriales Oct 11, 2024
f27029c
Add production envioroment and add user name
alejandrocabriales Oct 11, 2024
78e0ee4
Add posibility of run manually
alejandrocabriales Oct 11, 2024
c396987
Try other action
alejandrocabriales Oct 11, 2024
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
8 changes: 5 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true,
"jest/globals": true
},
"extends": [
Expand All @@ -21,15 +23,15 @@ module.exports = {
"rules": {
"indent": [
"error",
2
],
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
"double"
],
"semi": [
"error",
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Hello World!

on:
push:
branches:
- main

jobs:
hello_world_job:
runs-on: ubuntu-20.04
steps:
- name: Say hello
run: |
echo "Hello World!"
date_job:
runs-on: ubuntu-20.04
steps:
- name: Now it is
run: |
echo "The time is $(date)"
directory_job:
runs-on: ubuntu-20.04
steps:
- name: Directory Content
run: |
echo "The directory content is $(ls -l)"


39 changes: 39 additions & 0 deletions .github/workflows/notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build success/failure notification action

on:
push:
branches:
- main
workflow_dispatch:

jobs:
notify:
runs-on: ubuntu-20.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test

- name: Success

if: ${{ success() }}
uses: tenzin1308/[email protected]
with:
discord-webhook-url: ${{ secrets.WEBHOOKS_URL }}

- name: Failure
if: ${{ failure() }}
uses: tenzin1308/[email protected]
with:
discord-webhook-url: ${{ secrets.WEBHOOKS_URL }}
54 changes: 54 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deployment pipeline
on:
push:
branches:
- main

jobs:
simple_deployment_pipeline:
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ' '), '#skip') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Check style
run: npm run eslint
- name: Build
run: npm run build
- name: Run tests
run: npm run test

bump_version:
runs-on: ubuntu-20.04
needs: simple_deployment_pipeline
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ' '), '#skip') }}
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch

a_test_job:
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v4
- name: github context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: commits
env:
COMMITS: ${{ toJson(github.event.commits) }}
run: echo "$COMMITS"
- name: commit messages
env:
COMMIT_MESSAGES: ${{ toJson(github.event.commits.*.message) }}
run: echo "$COMMIT_MESSAGES"
26 changes: 26 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Playwright Tests
on:
push:
branches:
- main
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
dist/
node_modules/
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
13 changes: 7 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const express = require("express");
const app = express();
const express = require("express")
const app = express()

// get the port from env variable
const PORT = process.env.PORT || 5000;
const PORT = process.env.PORT || 5000

app.use(express.static("dist"));
app.use(express.static("dist"))

app.listen(PORT, () => {
console.log(`server started on port ${PORT}`);
});
// eslint-disable-next-line no-console
console.log(`server started on port ${PORT}`)
})
9 changes: 9 additions & 0 deletions e2e-tests/example.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { test, describe, expect } = require("@playwright/test")

describe("Pokedex", () => {
test("front page can be opened", async ({ page }) => {
await page.goto("")
await expect(page.getByText(/ivysaur/i)).toBeVisible()
await expect(page.getByText("Pokémon and Pokémon character names are trademarks of Nintendo.")).toBeVisible()
})
})
13 changes: 13 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

export default [
{
files: ["**/*.js"],
languageOptions: {
sourceType: "commonjs",
globals: {
...globals.node,
},
ecmaVersion: "latest",
},
},
]
Loading