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

Enhance GitHub workflows (handle Dependabot, etc.) #983

Merged
merged 19 commits into from Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/browserstack.yml
Expand Up @@ -12,6 +12,7 @@ jobs:
browserstack:
runs-on: ubuntu-latest
timeout-minutes: 30
if: "!(contains(github.event.*.labels.*.name, 'skip:ci') || github.actor == 'dependabot[bot]')"

steps:
- name: Clone repository
Expand Down
25 changes: 4 additions & 21 deletions .github/workflows/bundlewatch.yml
@@ -1,21 +1,13 @@
name: Bundlewatch
on:
push:
branches:
- main
paths:
- 'js/**'
- 'scss/**'
branches:
- main
- "!dependabot/**"
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
branches:
- main
- "!dependabot/**"
types: [labeled, unlabeled, opened, reopened, synchronize]
workflow_dispatch:

env:
Expand All @@ -25,38 +17,29 @@ env:
jobs:
bundlewatch:
runs-on: ubuntu-latest
if: "!(contains(github.event.*.labels.*.name, 'skip:ci') || github.actor == 'dependabot[bot]')"

steps:
- name: Bail early
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skip:ci')
run: exit 0

- name: Clone repository
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- run: node --version
- run: npm --version
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Install npm dependencies
run: npm ci
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run dist
run: npm run dist
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run bundlewatch
run: npm run bundlewatch
env:
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"
CI_BRANCH_BASE: main
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
6 changes: 5 additions & 1 deletion .github/workflows/calibreapp-image-actions.yml
@@ -1,12 +1,13 @@
name: Compress Images

on:
pull_request:
paths:
- '**.jpg'
- '**.jpeg'
- '**.png'
- '**.webp'
types: [opened, synchronize]
workflow_dispatch:

jobs:
build:
Expand All @@ -22,3 +23,6 @@ jobs:
uses: calibreapp/image-actions@1.1.0
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
jpegQuality: "75"
pngQuality: "75"
webpQuality: "75"
12 changes: 4 additions & 8 deletions .github/workflows/cspell.yml
Expand Up @@ -2,9 +2,10 @@ name: cspell

on:
push:
branches-ignore:
- "dependabot/**"
branches:
- main
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]
workflow_dispatch:

env:
Expand All @@ -14,15 +15,11 @@ env:
jobs:
cspell:
runs-on: ubuntu-latest
if: "!(contains(github.event.*.labels.*.name, 'skip:ci') || github.actor == 'dependabot[bot]')"

steps:
- name: Bail early
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skip:ci')
run: exit 0

- name: Clone repository
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run cspell
uses: streetsidesoftware/cspell-action@v2
Expand All @@ -31,4 +28,3 @@ jobs:
files: "**/*.md"
inline: error
incremental_files_only: false
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
24 changes: 4 additions & 20 deletions .github/workflows/css.yml
@@ -1,20 +1,12 @@
name: CSS
on:
push:
paths:
- "scss/**"
branches:
- main
- "!dependabot/**"
paths:
- "scss/**"
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
branches:
- main
- "!dependabot/**"
types: [labeled, unlabeled, opened, reopened, synchronize]
workflow_dispatch:

env:
Expand All @@ -24,31 +16,23 @@ env:
jobs:
css:
runs-on: ubuntu-latest
if: "!(contains(github.event.*.labels.*.name, 'skip:ci') || github.actor == 'dependabot[bot]') || github.event_name == 'workflow_dispatch'"

steps:
- name: Bail early
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skip:ci')
run: exit 0

- name: Clone repository
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- run: node --version
- run: npm --version
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Install npm dependencies
run: npm ci
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Build CSS
run: npm run css
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
26 changes: 4 additions & 22 deletions .github/workflows/docs.yml
@@ -1,22 +1,14 @@
name: Docs
on:
push:
branches:
- main
paths:
- 'js/**'
- 'scss/**'
- 'site/**'
branches:
- main
- "!dependabot/**"
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
branches:
- main
- "!dependabot/**"
types: [labeled, unlabeled, opened, reopened, synchronize]
workflow_dispatch:

env:
Expand All @@ -26,37 +18,28 @@ env:
jobs:
docs:
runs-on: ubuntu-latest
if: "!(contains(github.event.*.labels.*.name, 'skip:ci') || github.actor == 'dependabot[bot]')"

steps:
- name: Bail early
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skip:ci')
run: exit 0

- name: Clone repository
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- run: java -version
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Install npm dependencies
run: npm ci
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Build docs
run: npm run docs-build
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Validate HTML
run: npm run docs-vnu
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run linkinator
uses: JustinBeckwith/linkinator-action@v1
Expand All @@ -65,4 +48,3 @@ jobs:
recurse: true
verbosity: error
skip: "^(?!http://localhost)"
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
25 changes: 4 additions & 21 deletions .github/workflows/js.yml
@@ -1,20 +1,12 @@
name: JS Tests
on:
push:
paths:
- 'js/**'
branches:
- main
- "!dependabot/**"
paths:
- 'js/**'
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
branches:
- main
- "!dependabot/**"
types: [labeled, unlabeled, opened, reopened, synchronize]
workflow_dispatch:

env:
Expand All @@ -25,38 +17,29 @@ jobs:
run:
name: JS Tests
runs-on: ubuntu-latest
if: "!(contains(github.event.*.labels.*.name, 'skip:ci') || github.actor == 'dependabot[bot]')"

steps:
- name: Bail early
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skip:ci')
run: exit 0

- name: Clone repository
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE }}
cache: npm
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Install npm dependencies
run: npm ci
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run dist
run: npm run js
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run JS tests
run: npm run js-test
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Run Coveralls
uses: coverallsapp/github-action@1.1.3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
path-to-lcov: "./js/coverage/lcov.info"
23 changes: 4 additions & 19 deletions .github/workflows/lint.yml
@@ -1,21 +1,13 @@
name: Lint
on:
push:
branches:
- main
paths:
- 'js/**'
- 'scss/**'
branches:
- main
- "!dependabot/**"
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
branches:
- main
- "!dependabot/**"
types: [labeled, unlabeled, opened, reopened, synchronize]
workflow_dispatch:

env:
Expand All @@ -25,27 +17,20 @@ env:
jobs:
lint:
runs-on: ubuntu-latest
if: "!(contains(github.event.*.labels.*.name, 'skip:ci') || github.actor == 'dependabot[bot]')"

steps:
- name: Bail early
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'skip:ci')
run: exit 0

- name: Clone repository
uses: actions/checkout@v3
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Install npm dependencies
run: npm ci
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Lint
run: npm run lint
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))