Skip to content

Commit

Permalink
ci(events): paths filtering for push, labels filtering for pull_request
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed Jan 25, 2021
1 parent 38e025f commit 7c464f2
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 66 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ jobs:

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

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

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

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

- name: Set up npm cache
uses: actions/cache@v2
Expand All @@ -49,19 +49,19 @@ jobs:
restore-keys: |
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.os }}-node-v${{ env.NODE }}-
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci') && !contains(github.event.pull_request.labels.*.name, 'skip:browserstack'))

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

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

- name: Run BrowserStack tests
run: npm run js-test-cloud
env:
BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}"
BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}"
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci') && !contains(github.event.pull_request.labels.*.name, 'skip:browserstack'))
20 changes: 12 additions & 8 deletions .github/workflows/bundlewatch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Bundlewatch
on:
push:
paths:
- 'js/**'
- 'scss/**'
branches:
- v5-dev
- "!dependabot/**"
Expand All @@ -21,25 +24,26 @@ env:
jobs:
bundlewatch:
runs-on: ubuntu-latest
if: github.repository == 'Orange-OpenSource/Orange-Boosted-Bootstrap'

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

- name: Clone repository
uses: actions/checkout@v2
if: failure()
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@v2
with:
node-version: "${{ env.NODE }}"
if: failure()
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: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up npm cache
uses: actions/cache@v2
Expand All @@ -49,19 +53,19 @@ jobs:
restore-keys: |
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.os }}-node-v${{ env.NODE }}-
if: failure()
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: failure()
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: failure()
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: v5-dev
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
17 changes: 10 additions & 7 deletions .github/workflows/css.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: CSS
on:
push:
paths:
- "scss/**"
branches:
- v5-dev
- "!dependabot/**"
Expand All @@ -21,25 +23,26 @@ env:
jobs:
css:
runs-on: ubuntu-latest
if: github.repository == 'Orange-OpenSource/Orange-Boosted-Bootstrap'

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

- name: Clone repository
uses: actions/checkout@v2
if: failure()
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@v2
with:
node-version: "${{ env.NODE }}"
if: failure()
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: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up npm cache
uses: actions/cache@v2
Expand All @@ -49,12 +52,12 @@ jobs:
restore-keys: |
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.os }}-node-v${{ env.NODE }}-
if: failure()
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: failure()
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: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
19 changes: 12 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Docs
on:
push:
paths:
- 'js/**'
- 'scss/**'
- 'site/**'
branches:
- v5-dev
- "!dependabot/**"
Expand All @@ -21,24 +25,25 @@ env:
jobs:
docs:
runs-on: ubuntu-latest
if: github.repository == 'Orange-OpenSource/Orange-Boosted-Bootstrap'

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

- name: Clone repository
uses: actions/checkout@v2
if: failure()
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@v2
with:
node-version: "${{ env.NODE }}"
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

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

- name: Set up npm cache
uses: actions/cache@v2
Expand All @@ -48,12 +53,12 @@ jobs:
restore-keys: |
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.os }}-node-v${{ env.NODE }}-
if: failure()
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: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Test docs
run: npm run docs
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
19 changes: 11 additions & 8 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: JS Tests
on:
push:
paths:
- 'js/**'
branches:
- v5-dev
- "!dependabot/**"
Expand All @@ -21,6 +23,7 @@ jobs:
run:
name: Node ${{ matrix.node }}
runs-on: ubuntu-latest
if: github.repository == 'Orange-OpenSource/Orange-Boosted-Bootstrap'

strategy:
fail-fast: false
Expand All @@ -29,18 +32,18 @@ jobs:

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

- name: Clone repository
uses: actions/checkout@v2
if: failure()
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@v2
with:
node-version: ${{ matrix.node }}
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up npm cache
uses: actions/cache@v2
Expand All @@ -50,24 +53,24 @@ jobs:
restore-keys: |
${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.os }}-node-v${{ matrix.node }}-
if: failure()
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: failure()
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: failure()
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: failure()
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@master
if: matrix.node == 14
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
path-to-lcov: "./js/coverage/lcov.info"
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
16 changes: 10 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Lint
on:
push:
paths:
- 'js/**'
- 'scss/**'
branches:
- v5-dev
- "!dependabot/**"
Expand All @@ -21,21 +24,22 @@ env:
jobs:
lint:
runs-on: ubuntu-latest
if: github.repository == 'Orange-OpenSource/Orange-Boosted-Bootstrap'

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

- name: Clone repository
uses: actions/checkout@v2
if: failure()
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@v2
with:
node-version: "${{ env.NODE }}"
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Set up npm cache
uses: actions/cache@v2
Expand All @@ -45,12 +49,12 @@ jobs:
restore-keys: |
${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.os }}-node-v${{ env.NODE }}-
if: failure()
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: failure()
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: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
11 changes: 7 additions & 4 deletions .github/workflows/node-sass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: CSS (node-sass)

on:
push:
paths:
- 'scss/**'
branches:
- v5-dev
- "!dependabot/**"
Expand All @@ -22,25 +24,26 @@ env:
jobs:
css:
runs-on: ubuntu-latest
if: github.repository == 'Orange-OpenSource/Orange-Boosted-Bootstrap'

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

- name: Clone repository
uses: actions/checkout@v2
if: failure()
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@v2
with:
node-version: "${{ env.NODE }}"
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))

- name: Build CSS with node-sass
run: |
npx --package node-sass@latest node-sass --version
npx --package node-sass@latest node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/ -o dist-sass/css/
ls -Al dist-sass/css
if: failure()
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip:ci'))
Loading

0 comments on commit 7c464f2

Please sign in to comment.