-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update pipeline with v4 changes (#289)
* ci: migrate to GitHub Actions (#286) * ci: schedule github actions updates * ci: add github actions release workflow * ci: remove config related to travis * ci: split workflows * ci: use action for installing dependencies * ci: remove lint max warnings * ci: improve scripts * ci: remove format check * ci: install dependencies with npm * ci: revert - install dependencies with npm * ci: install dependencies manually on test step * ci: set ci env var on install step * ci: install peer deps in legacy mode * ci: revert manual deps install * ci: remove node 15 * ci: update badge in README.md Closes #275 * ci: github actions improvements (#288) * chore: fix scripts related to testing * ci: bump checkout action to v2 * ci: merge workflows files into single one * ci: add a step for canceling previous runs * ci: remove workflow run conditions * ci: rename workflow * ci: update github actions with v4 CI changes * chore: bump dependencies to last minor * chore: setting test environment to jest-environment-jsdom v25 I had to downgrade jsdom because of some errors jsdom v16 was causing when running tests in node v10. Apparently, jsdom v16 is compatible with node v10, so I'm not sure why is causing an issue. This can be removed when dropping support for node v10.
- Loading branch information
Showing
6 changed files
with
152 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
# Set update schedule for GitHub Actions | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
# semantic-release valid branches, excluding all-contributors | ||
- '+([0-9])?(.{+([0-9]),x}).x' | ||
- 'main' | ||
- 'next' | ||
- 'next-major' | ||
- 'beta' | ||
- 'alpha' | ||
- '!all-contributors/**' | ||
pull_request: | ||
types: [ opened, synchronize ] | ||
|
||
jobs: | ||
code_validation: | ||
name: Code Validation | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
|
||
- name: Check Types | ||
run: npm run type-check | ||
|
||
- name: Lint code | ||
run: npm run lint | ||
|
||
- name: Check format | ||
run: npm run format:check -- --max-warnings 0 | ||
|
||
tests: | ||
name: Tests (Node v${{ matrix.node }} - ESLint v${{ matrix.eslint }}) | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node: [ '10.22.1', '10', '12', '14' ] | ||
eslint: [ '7.5', '7', ] | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
|
||
- name: Install ESLint v${{ matrix.eslint }} | ||
run: npm install --no-save eslint@${{ matrix.eslint }} | ||
|
||
- name: Run tests | ||
run: npm run test:ci | ||
|
||
release: | ||
name: NPM Release | ||
needs: [code_validation, tests] | ||
runs-on: ubuntu-latest | ||
if: | ||
${{ github.repository == 'testing-library/eslint-plugin-testing-library' && | ||
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', | ||
github.ref) && github.event_name == 'push' }} | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
uses: bahmutov/npm-install@v1 | ||
with: | ||
useLockFile: false | ||
|
||
- name: Build package | ||
run: npm run build | ||
|
||
- name: Release new version to NPM | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters