From e82aa1a8f6aeff037021a0092607b343a12378f5 Mon Sep 17 00:00:00 2001 From: Claire Olmstead Date: Mon, 2 Dec 2024 11:49:43 -0800 Subject: [PATCH 1/4] add svelte-check to github workflows --- .github/workflows/svelte-check.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/svelte-check.yaml diff --git a/.github/workflows/svelte-check.yaml b/.github/workflows/svelte-check.yaml new file mode 100644 index 0000000..2d0e329 --- /dev/null +++ b/.github/workflows/svelte-check.yaml @@ -0,0 +1,29 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Svelte Check +on: + push: + branches: ['main', 'feat/svelte-app', '67-add-svelte-check-to-github-workflows---styleguide'] + pull_request: + branches: ['main', 'feat/svelte-app', '67-add-svelte-check-to-github-workflows---styleguide'] + +jobs: + prettier: + name: Svelte Check + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install Dependencies + run: npm ci + + - name: Check svelte/ts with svelte-check + run: npm run check From 35efa61cbfe4e851848bb65703fbda16d7ae2f27 Mon Sep 17 00:00:00 2001 From: Claire Olmstead Date: Mon, 2 Dec 2024 11:52:19 -0800 Subject: [PATCH 2/4] add prettier workflow too --- .github/workflows/prettier.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/prettier.yaml diff --git a/.github/workflows/prettier.yaml b/.github/workflows/prettier.yaml new file mode 100644 index 0000000..e434d97 --- /dev/null +++ b/.github/workflows/prettier.yaml @@ -0,0 +1,29 @@ +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Prettier checks +on: + push: + branches: ['main', '67-add-svelte-check-to-github-workflows---styleguide'] + pull_request: + branches: ['main', '67-add-svelte-check-to-github-workflows---styleguide'] + +jobs: + prettier: + name: Prettier + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install Dependencies + run: npm ci + + - name: Check formatting with Prettier + run: npm run prettier:check:ci From 9b29ce6ae1abd6838e4c9ffed75dc419d1c16b46 Mon Sep 17 00:00:00 2001 From: Claire Olmstead Date: Mon, 2 Dec 2024 11:54:47 -0800 Subject: [PATCH 3/4] add prettier:check:ci to package --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index ca72226..967aa70 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "lint:fix": "eslint --fix", "format": "npm run prettier && npm run lint:fix", "prettier": "prettier --write --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss src", + "prettier:check:ci": "npx prettier --check --plugin prettier-plugin-tailwindcss --plugin prettier-plugin-svelte src", "check": "svelte-check --tsconfig ./tsconfig.json" }, "devDependencies": { From 9c59d2c555def55ad21e872638d974d1fbb14f54 Mon Sep 17 00:00:00 2001 From: Claire Olmstead Date: Mon, 2 Dec 2024 13:49:16 -0800 Subject: [PATCH 4/4] remove current branch from branch list --- .github/workflows/svelte-check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/svelte-check.yaml b/.github/workflows/svelte-check.yaml index 2d0e329..71a26c4 100644 --- a/.github/workflows/svelte-check.yaml +++ b/.github/workflows/svelte-check.yaml @@ -2,9 +2,9 @@ name: Svelte Check on: push: - branches: ['main', 'feat/svelte-app', '67-add-svelte-check-to-github-workflows---styleguide'] + branches: ['main', 'feat/svelte-app'] pull_request: - branches: ['main', 'feat/svelte-app', '67-add-svelte-check-to-github-workflows---styleguide'] + branches: ['main', 'feat/svelte-app'] jobs: prettier: