diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml index 22091eec6f..de197efb9e 100644 --- a/.github/workflows/browserstack.yml +++ b/.github/workflows/browserstack.yml @@ -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 @@ -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')) diff --git a/.github/workflows/bundlewatch.yml b/.github/workflows/bundlewatch.yml index f9d39c5e40..dee06bf5a5 100644 --- a/.github/workflows/bundlewatch.yml +++ b/.github/workflows/bundlewatch.yml @@ -1,6 +1,9 @@ name: Bundlewatch on: push: + paths: + - 'js/**' + - 'scss/**' branches: - v5-dev - "!dependabot/**" @@ -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 @@ -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')) diff --git a/.github/workflows/css.yml b/.github/workflows/css.yml index 0f83721f81..3395401597 100644 --- a/.github/workflows/css.yml +++ b/.github/workflows/css.yml @@ -1,6 +1,8 @@ name: CSS on: push: + paths: + - "scss/**" branches: - v5-dev - "!dependabot/**" @@ -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 @@ -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')) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index c576fe54d8..6915d1fa8c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,6 +1,10 @@ name: Docs on: push: + paths: + - 'js/**' + - 'scss/**' + - 'site/**' branches: - v5-dev - "!dependabot/**" @@ -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 @@ -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')) diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 8d31264a23..b29ad5e99f 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -1,6 +1,8 @@ name: JS Tests on: push: + paths: + - 'js/**' branches: - v5-dev - "!dependabot/**" @@ -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 @@ -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 @@ -50,19 +53,19 @@ 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 @@ -70,4 +73,4 @@ jobs: 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')) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0d3e0dcd76..2e7ac4244f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,9 @@ name: Lint on: push: + paths: + - 'js/**' + - 'scss/**' branches: - v5-dev - "!dependabot/**" @@ -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 @@ -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')) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index 625f56f40f..ffb6725987 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -2,6 +2,8 @@ name: CSS (node-sass) on: push: + paths: + - 'scss/**' branches: - v5-dev - "!dependabot/**" @@ -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')) diff --git a/.github/workflows/pa11y.yml b/.github/workflows/pa11y.yml index 1cd25136bb..3262571510 100644 --- a/.github/workflows/pa11y.yml +++ b/.github/workflows/pa11y.yml @@ -1,6 +1,10 @@ name: Tests on: push: + paths: + - 'js/**' + - 'scss/**' + - 'site/**' branches: - v5-dev - "!dependabot/**" @@ -21,21 +25,22 @@ env: jobs: pa11y: 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') || contains(github.event.*.labels.*.name, 'skip:pa11y')) + if: github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'skip:ci') || contains(github.event.pull_request.labels.*.name, 'skip:pa11y')) 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:pa11y')) - name: Set up Node.js uses: actions/setup-node@v1 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:pa11y')) - name: Set up npm cache uses: actions/cache@v2 @@ -45,31 +50,31 @@ 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:pa11y')) - 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:pa11y')) - name: Compile 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:pa11y')) - name: Test docs run: npm run docs-build - 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:pa11y')) - name: Run accessibility tests run: npm run docs-accessibility - 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:pa11y')) - name: Generate HTML accessibility results run: npm run docs-pa11y-html - 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:pa11y')) - name: Upload accessibility results uses: actions/upload-artifact@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:pa11y')) with: name: pa11y-ci-results path: .pa11y/ diff --git a/.github/workflows/percy.yml b/.github/workflows/percy.yml index 3cb64488e3..bbe66d1b31 100644 --- a/.github/workflows/percy.yml +++ b/.github/workflows/percy.yml @@ -1,6 +1,10 @@ name: Tests on: push: + paths: + - 'js/**' + - 'scss/**' + - 'site/content/docs/**/guidelines' branches: - v5-dev - "!dependabot/**" @@ -21,21 +25,22 @@ env: jobs: percy: 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') || contains(github.event.*.labels.*.name, 'skip:percy')) + if: github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'skip:ci') || contains(github.event.pull_request.labels.*.name, 'skip:percy')) 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:percy')) - name: Set up Node.js uses: actions/setup-node@v1 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:percy')) - name: Set up npm cache uses: actions/cache@v2 @@ -45,19 +50,19 @@ 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') && !contains(github.event.pull_request.labels.*.name, 'skip:percy')) - 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:percy')) - name: Compile 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:percy')) - name: Build docs run: npm run docs-build - 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:percy')) - name: Percy Test uses: percy/snapshot-action@v0.1.2 @@ -67,4 +72,4 @@ jobs: verbose: true env: PERCY_TOKEN: "${{ secrets.PERCY_TOKEN }}" - 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:percy'))