Skip to content

Commit

Permalink
Fix: codespaces and ci. And added multiple themes
Browse files Browse the repository at this point in the history
  • Loading branch information
gagansuie committed Nov 30, 2022
1 parent c53c012 commit d091ac3
Show file tree
Hide file tree
Showing 14 changed files with 836 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:18-bullseye"
"image": "mcr.microsoft.com/devcontainers/typescript-node:18-bullseye",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"forwardPorts": [5173]

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: ci-dev.yml

on:
push:
branches:
- main
workflow_dispatch:

jobs:
test:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Test using Playwright
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 17

- name: Install Dependencies
run: |
npm install
npx playwright install
- name: Install Playwright Browser
run: |
npx playwright install-deps
- name: Run Playwright Tests
continue-on-error: true
run: npm run test

- name: Convert E2E Report to Coverage Report
run: |
npm install playwright-e2e-coverage-report
wget https://raw.githubusercontent.com/CodeCrowCorp/playwright-e2e-coverage-report/master/scripts/reportConverter.js
chmod u+x reportConverter.js
node ./reportConverter.js
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.1
if: always()
with:
name: results.json
path: ./results.json
retention-days: 30

- name: Send to Codecov
uses: codecov/codecov-action@v3.1.1
with:
files: ./results.json
flags: "e2ecoverage"

# deploy:
# if: ${{ github.actor != 'dependabot[bot]' }}
# name: Deploy to Cloudflare Pages (Dev)
# needs: [test]
# runs-on: ubuntu-latest
# permissions:
# contents: read
# deployments: write

# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Install Node
# uses: actions/setup-node@v3
# with:
# node-version: 17

# - name: Install NPM and build
# run: npm install && npm run build

# - name: Publish
# uses: cloudflare/wrangler-action@2.0.0
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# command: pages publish ".svelte-kit/cloudflare" --project-name=cro-website
112 changes: 112 additions & 0 deletions .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: ci-prod.yml

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
deployments: write

jobs:
test:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Test using Playwright
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 17

- name: Install Dependencies
run: |
npm install
npx playwright install
- name: Install Playwright Browser
run: |
npx playwright install-deps
- name: Run Playwright Tests
continue-on-error: true
run: npm run test

- name: Convert E2E Report to Coverage Report
run: |
npm install playwright-e2e-coverage-report
wget https://raw.githubusercontent.com/CodeCrowCorp/playwright-e2e-coverage-report/master/scripts/reportConverter.js
chmod u+x reportConverter.js
node ./reportConverter.js
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.1
if: always()
with:
name: results.json
path: ./results.json
retention-days: 30

- name: Send to Codecov
uses: codecov/codecov-action@v3.1.1
with:
files: ./results.json
flags: "e2ecoverage"

# deploy:
# if: ${{ github.actor != 'dependabot[bot]' }}
# name: Deploy to Cloudflare Pages (Production)
# needs: [test]
# runs-on: ubuntu-latest
# permissions:
# contents: read
# deployments: write

# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Install Node
# uses: actions/setup-node@v3
# with:
# node-version: 17

# - name: Install NPM and build
# run: npm install && npm run build

# - name: Publish
# uses: cloudflare/wrangler-action@2.0.0
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# command: pages publish ".svelte-kit/cloudflare" --project-name=cro-website

# create-tag:
# if: ${{ github.actor != 'dependabot[bot]' }}
# name: Create Tag and Release
# runs-on: ubuntu-latest
# needs: [deploy]
# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Get NPM version
# id: package-version
# uses: martinbeentjes/npm-get-version-action@main

# - name: Create a tag and release
# uses: ncipollo/release-action@v1.11.2
# with:
# tag: ${{ steps.package-version.outputs.current-version }}
# name: v${{ steps.package-version.outputs.current-version }}
# token: ${{ secrets.GITHUB_TOKEN }}
# generateReleaseNotes: true
# continue-on-error: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<br>

<h3 align="center">
A Svelte port of the Code Crow project
Svelte port of cro-website
</h3>

<br>
Expand Down
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"private": true,
"type": "module",
"scripts": {
"dev:only": "vite dev",
"dev:only": "vite dev --host",
"build:only": "vite build",
"tailwind:watch": "cross-env TAILWIND_MODE=watch cross-env NODE_ENV=development postcss src/assets/styles/tailwind.css -o src/assets/styles/tailwind-output.css -w",
"tailwind:build": "cross-env TAILWIND_MODE=build cross-env NODE_ENV=production postcss src/assets/styles/tailwind.css -o src/assets/styles/tailwind-output.css",
"tailwind:watch": "cross-env TAILWIND_MODE=watch cross-env NODE_ENV=development postcss src/app.css -o src/assets/styles/tailwind-output.css -w",
"tailwind:build": "cross-env TAILWIND_MODE=build cross-env NODE_ENV=production postcss src/app.css -o src/assets/styles/tailwind-output.css",
"dev": "concurrently \"npm run dev:only\" \"npm run tailwind:watch\"",
"build": "npm run tailwind:build && npm run build:only",
"preview": "vite preview",
Expand Down Expand Up @@ -50,6 +50,7 @@
"animate.css": "^4.1.1",
"daisyui": "^2.42.1",
"nprogress": "^0.2.0",
"playwright-e2e-coverage-report": "^1.0.20"
"playwright-e2e-coverage-report": "^1.0.20",
"theme-change": "^2.2.0"
}
}
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
Expand Down
Loading

0 comments on commit d091ac3

Please sign in to comment.