Skip to content

Commit

Permalink
chore: update ci setup
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundhung committed May 23, 2022
1 parent 6a7e0d4 commit 5887960
Showing 1 changed file with 37 additions and 55 deletions.
92 changes: 37 additions & 55 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,62 @@ on:
- push
jobs:
test:
name: 🧨 Trying to break it
name: πŸ” Testing
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v1
- name: πŸ›‘ Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
node-version: 16.13
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-
${{ runner.OS }}-
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install chromium --with-deps
- name: Build the worker
node-version: 16
- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: 🎭 Install Playwright
run: npx playwright install --with-deps
- name: πŸ“¦ Build the worker
run: npm run build
- name: Run some tests
- name: πŸ’£ Run some tests
run: npm run test

lint:
name: πŸ” Checking the recipes
name: ⬣ Linting
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.13
- name: Cache dependencies
uses: actions/cache@v2
- name: πŸ›‘ Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-
${{ runner.OS }}-
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Code format check
node-version: 16
- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: ✨ Code format check
run: npx prettier --check .
- name: Code linting
- name: βœ… Code linting
run: npx eslint . --ext .js,.mjs,.ts,.tsx

deploy:
name: πŸ›³οΈ Shipping something new
name: πŸ›³ Deploying
needs: [test, lint]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 16.13
- name: Cache dependencies
uses: actions/cache@v2
- name: πŸ›‘ Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: βŽ” Setup node
uses: actions/setup-node@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-
${{ runner.OS }}-
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Publish
node-version: 16
- name: πŸ“₯ Download deps
uses: bahmutov/npm-install@v1
- name: πŸ”₯ Publish
run: npx wrangler publish
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}

0 comments on commit 5887960

Please sign in to comment.