From e7604207a185f506fe75fdc53d2a58ab37591ae2 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 26 Sep 2019 16:25:26 +0300 Subject: Split GitHub Actions. Everything should be faster now. Also, we can restart a failed workflow and not the whole thing like before. --- .github/workflows/browserstack.yml | 39 +++++++++++++++++++++++++ .github/workflows/bundlewatch.yml | 38 ++++++++++++++++++++++++ .github/workflows/css.yml | 33 +++++++++++++++++++++ .github/workflows/docs.yml | 35 ++++++++++++++++++++++ .github/workflows/js.yml | 48 ++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 33 +++++++++++++++++++++ .github/workflows/test.yml | 60 -------------------------------------- 7 files changed, 226 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/browserstack.yml create mode 100644 .github/workflows/bundlewatch.yml create mode 100644 .github/workflows/css.yml create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/js.yml create mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml (limited to '.github/workflows') diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml new file mode 100644 index 000000000..a14bd83f0 --- /dev/null +++ b/.github/workflows/browserstack.yml @@ -0,0 +1,39 @@ +name: BrowserStack +on: [push] +env: + CI: true + NODE: 10.x + +jobs: + browserstack: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: "${{ env.NODE }}" + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/browserstack.yml') }} + restore-keys: | + ${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/browserstack.yml') }} + ${{ runner.OS }}-node-v${{ env.NODE }}- + + - name: Install npm dependencies + run: npm ci + + - name: Run dist + run: npm run dist + + - 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 }}" diff --git a/.github/workflows/bundlewatch.yml b/.github/workflows/bundlewatch.yml new file mode 100644 index 000000000..5a2ccc877 --- /dev/null +++ b/.github/workflows/bundlewatch.yml @@ -0,0 +1,38 @@ +name: Bundlewatch +on: [push, pull_request] +env: + CI: true + NODE: 10.x + +jobs: + bundlewatch: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: "${{ env.NODE }}" + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/bundlesize.yml') }} + restore-keys: | + ${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/bundlesize.yml') }} + ${{ runner.OS }}-node-v${{ env.NODE }}- + + - name: Install npm dependencies + run: npm ci + + - name: Run dist + run: npm run dist + + - name: Run bundlewatch + run: npm run bundlewatch + env: + BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" diff --git a/.github/workflows/css.yml b/.github/workflows/css.yml new file mode 100644 index 000000000..cb4159da2 --- /dev/null +++ b/.github/workflows/css.yml @@ -0,0 +1,33 @@ +name: CSS +on: [push, pull_request] +env: + CI: true + NODE: 10.x + +jobs: + css: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: "${{ env.NODE }}" + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/css.yml') }} + restore-keys: | + ${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/css.yml') }} + ${{ runner.OS }}-node-v${{ env.NODE }}- + + - name: Install npm dependencies + run: npm ci + + - name: Build CSS + run: npm run css diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..d40371d60 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,35 @@ +name: Docs +on: [push, pull_request] +env: + CI: true + NODE: 10.x + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: "${{ env.NODE }}" + + - run: java -version + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/docs.yml') }} + restore-keys: | + ${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/docs.yml') }} + ${{ runner.OS }}-node-v${{ env.NODE }}- + + - name: Install npm dependencies + run: npm ci + + - name: Test docs + run: npm run docs diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml new file mode 100644 index 000000000..2d0c72b6b --- /dev/null +++ b/.github/workflows/js.yml @@ -0,0 +1,48 @@ +name: JS Tests +on: [push, pull_request] +env: + CI: true + +jobs: + run: + name: Node ${{ matrix.node }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node: [10, 12] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} + restore-keys: | + ${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} + ${{ runner.OS }}-node-v${{ matrix.node }}- + + - name: Install npm dependencies + run: npm ci + + - name: Run dist + run: npm run js + + - name: Run JS tests + run: npm run js-test + + - name: Run Coveralls + uses: coverallsapp/github-action@master + if: matrix.node == 10 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + path-to-lcov: "./js/coverage/lcov.info" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..715bdae1c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: Lint +on: [push, pull_request] +env: + CI: true + NODE: 10.x + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v1 + with: + node-version: "${{ env.NODE }}" + + - name: Set up npm cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/lint.yml') }} + restore-keys: | + ${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/lint.yml') }} + ${{ runner.OS }}-node-v${{ env.NODE }}- + + - name: Install npm dependencies + run: npm ci + + - name: Lint CSS and JS + run: npm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index a990301dc..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Tests -on: [push, pull_request] -env: - CI: true - -jobs: - run: - name: Node ${{ matrix.node }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - node: [10, 12] - - steps: - - name: Clone repository - uses: actions/checkout@v2 - - - name: Set Node.js version - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - - run: java -version - - - name: Set up npm cache - uses: actions/cache@v2 - with: - path: ~/.npm - key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}} - restore-keys: | - ${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }} - ${{ runner.OS }}-node-v${{ matrix.node }}- - - - name: Install npm dependencies - run: npm ci - - - name: Run tests - run: npm test - - - name: Run bundlewatch - run: npm run bundlewatch - if: matrix.node == 10 - env: - BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}" - - - name: Run BrowserStack tests - run: npm run js-test-cloud - if: matrix.node == 10 && github.repository == 'twbs/bootstrap' && github.event_name == 'push' - env: - BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}" - BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}" - - - name: Run Coveralls - uses: coverallsapp/github-action@master - if: matrix.node == 10 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - path-to-lcov: "./js/coverage/lcov.info" -- cgit v1.2.3