Skip to content

Commit 9ecc3a7

Browse files
authored
Merge pull request #202 from javierbrea/release
Release v1.2.5
2 parents 5dde5af + 240c193 commit 9ecc3a7

19 files changed

+2361
-2512
lines changed

.github/workflows/build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release
7+
pull_request:
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node: ["12.19.0", "14.15.0", "15.2.0"]
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Extract branch name
18+
shell: bash
19+
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
20+
id: extract-branch
21+
- name: Use Node.js
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node }}
25+
- name: Cache node modules
26+
uses: actions/cache@v2
27+
env:
28+
cache-name: cache-node-modules
29+
with:
30+
# npm cache files are stored in `~/.npm` on Linux/macOS
31+
path: ~/.npm
32+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-build-${{ env.cache-name }}-
35+
${{ runner.os }}-build-
36+
${{ runner.os }}-
37+
- name: Install dependencies
38+
run: npm ci
39+
- name: Lint
40+
run: npm run lint
41+
- name: Test unit
42+
run: npm run test:unit
43+
- name: Test mutation
44+
run: npm run test:mutation
45+
env:
46+
BRANCH_NAME: ${{ steps.extract-branch.outputs.branch }}
47+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_TOKEN }}
48+
- name: Test E2E
49+
run: npm run test:e2e
50+
id: test-e2e
51+
- name: Upload E2E tests screenshots
52+
if: ${{ always() && steps.test-e2e.outcome == 'failure' }}
53+
uses: actions/upload-artifact@v2
54+
with:
55+
name: e2e-screenshots-${{ matrix.node }}
56+
path: test-e2e/react-app/cypress/screenshots
57+
retention-days: 7
58+
- name: Upload typescript E2E tests screenshots
59+
if: ${{ always() && steps.test-e2e.outcome == 'failure' }}
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: e2e-typescript-screenshots-${{ matrix.node }}
63+
path: test-e2e/typescript/cypress/screenshots
64+
retention-days: 7
65+
- name: Upload test results
66+
uses: actions/upload-artifact@v2
67+
with:
68+
name: coverage-${{ matrix.node }}
69+
path: coverage
70+
retention-days: 1
71+
quality:
72+
runs-on: ubuntu-latest
73+
needs: test
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v2
77+
- name: Download test results
78+
uses: actions/download-artifact@v2
79+
with:
80+
name: coverage-15.2.0
81+
path: coverage
82+
- name: Coveralls
83+
uses: coverallsapp/github-action@master
84+
with:
85+
github-token: ${{ secrets.GITHUB_TOKEN }}
86+
- name: SonarCloud Scan
87+
uses: sonarsource/sonarcloud-github-action@master
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: check-package-version
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
jobs:
7+
check-package-version:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Get NPM version is new
13+
id: check
14+
uses: EndBug/[email protected]
15+
with:
16+
diff-search: true
17+
file-name: ./package.json
18+
file-url: https://unpkg.com/cypress-localstorage-commands@latest/package.json
19+
static-checking: localIsNew
20+
- name: Check version is new
21+
if: steps.check.outputs.changed != 'true'
22+
run: |
23+
echo "Version not changed"
24+
exit 1
25+
- name: Get NPM version
26+
id: package-version
27+
uses: martinbeentjes/[email protected]
28+
- name: Check Changelog version
29+
id: changelog_reader
30+
uses: mindsers/[email protected]
31+
with:
32+
version: ${{ steps.package-version.outputs.current-version }}
33+
path: ./CHANGELOG.md
34+
- name: Read version from Sonar config
35+
id: sonar-version
36+
uses: christian-draeger/[email protected]
37+
with:
38+
path: './sonar-project.properties'
39+
property: 'sonar.projectVersion'
40+
- name: Check Sonar version
41+
if: steps.sonar-version.outputs.value != steps.package-version.outputs.current-version
42+
run: |
43+
echo "Version not changed"
44+
exit 1
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: publish-to-github
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
# Setup .npmrc file to publish to GitHub Packages
11+
- uses: actions/setup-node@v1
12+
with:
13+
node-version: '12.x'
14+
registry-url: 'https://npm.pkg.github.com'
15+
# Defaults to the user or organization that owns the workflow file
16+
scope: '@javierbrea'
17+
- uses: MerthinTechnologies/edit-json-action@v1
18+
with:
19+
filename: './package.json'
20+
key: 'name'
21+
value: '@javierbrea/cypress-localstorage-commands'
22+
- run: npm ci
23+
- run: npm publish
24+
env:
25+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: publish-to-npm
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-node@v1
11+
with:
12+
node-version: '12.x'
13+
registry-url: 'https://registry.npmjs.org/'
14+
- run: npm ci
15+
- run: npm publish
16+
env:
17+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ yarn-error.log*
2828
/reports
2929
.stryker-tmp
3030
stryker.conf.local.js
31+
32+
# caches
33+
.eslintcache

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
### Removed
1212
### BREAKING CHANGES
1313

14+
## [1.2.5] - 2020-12-05
15+
16+
### Changed
17+
- chore(ci): Migrate CI to github actions. Rename npm commands
18+
- chore(deps): Add Cypress 6.x to peerDependencies
19+
- chore(test): Update Cypress to v6.0.1 in e2e tests
20+
- chore(deps): Update devDependencies
21+
1422
## [1.2.4] - 2020-10-29
1523

1624
### Added

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build status][travisci-image]][travisci-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url] [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fjavierbrea%2Fcypress-localstorage-commands%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/javierbrea/cypress-localstorage-commands/master)
1+
[![Build status][build-image]][build-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url] [![Mutation testing status][mutation-image]][mutation-url]
22

33
[![NPM dependencies][npm-dependencies-image]][npm-dependencies-url] [![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com) [![Last commit][last-commit-image]][last-commit-url] [![Last release][release-image]][release-url]
44

@@ -181,8 +181,10 @@ MIT, see [LICENSE](./LICENSE) for details.
181181

182182
[coveralls-image]: https://coveralls.io/repos/github/javierbrea/cypress-localstorage-commands/badge.svg
183183
[coveralls-url]: https://coveralls.io/github/javierbrea/cypress-localstorage-commands
184-
[travisci-image]: https://travis-ci.com/javierbrea/cypress-localstorage-commands.svg?branch=master
185-
[travisci-url]: https://travis-ci.com/javierbrea/cypress-localstorage-commands
184+
[build-image]: https://github.com/javierbrea/cypress-localstorage-commands/workflows/build/badge.svg?branch=chore-deps-cypress-6
185+
[build-url]: https://github.com/javierbrea/cypress-localstorage-commands/actions?query=workflow%3Abuild
186+
[mutation-image]: https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fjavierbrea%2Fcypress-localstorage-commands%2Fmaster
187+
[mutation-url]: https://dashboard.stryker-mutator.io/reports/github.com/javierbrea/cypress-localstorage-commands/master
186188
[last-commit-image]: https://img.shields.io/github/last-commit/javierbrea/cypress-localstorage-commands.svg
187189
[last-commit-url]: https://github.com/javierbrea/cypress-localstorage-commands/commits
188190
[license-image]: https://img.shields.io/npm/l/cypress-localstorage-commands.svg

0 commit comments

Comments
 (0)