From 1a6a2c714e4d399a263bbe9e1ccd898c3bd6c491 Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Wed, 29 Nov 2023 12:15:49 +0100 Subject: [PATCH 1/2] feat: migrate to GitHub Actions --- .github/workflows/workflow.yml | 113 +++++++++++++++++++++++++++++++++ .travis.yml | 29 --------- sonar-project.properties | 4 +- 3 files changed, 115 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/workflow.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..34bce65 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,113 @@ +name: Test +on: + push: + branches: + - master + pull_request: + branches: [ master ] +jobs: + lint: + name: Lint Code Base + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_JSCPD: false # Can not exclude specific file: https://github.com/kucherenko/jscpd/issues/215 + VALIDATE_TYPESCRIPT_STANDARD: false + VALIDATE_MARKDOWN: false + build: + name: Build + needs: lint + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v2 + with: + version: latest + run_install: true + - name: Build + run: pnpm run build + - name: Upload build + uses: actions/upload-artifact@v3 + with: + name: build + path: dist + tests: + name: Unit Tests + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v2 + with: + version: latest + run_install: | + - recursive: false + - name: Run Unit Tests + run: pnpm test + - uses: actions/upload-artifact@v3 + with: + name: unittest-coverage + path: coverage/lcov.info + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + if: github.event_name == 'push' + needs: + - tests + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: actions/download-artifact@v3 + with: + name: unittest-coverage + path: coverage + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + release: + name: Release + runs-on: ubuntu-latest + if: github.event_name == 'push' + needs: + - build + - sonarcloud + - tests + steps: + - uses: actions/checkout@v3 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: pnpm/action-setup@v2 + with: + version: latest + run_install: | + - recursive: false + - name: Download build + uses: actions/download-artifact@v3 + with: + name: build + path: dist + - run: mkdir -p docs + - run: pnpx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d91017..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: node_js -os: linux -dist: focal - -cache: - directories: - - node_modules - -install: - - npm i pnpm -g - - pnpm install - -jobs: - include: - - stage: test code - addons: - sonarcloud: - organization: saitho - script: - - pnpm test - - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi' # sonar only on non-PRs - - stage: release - if: branch = master - node_js: lts/* - deploy: - provider: script - skip_cleanup: true - script: - - pnpx semantic-release diff --git a/sonar-project.properties b/sonar-project.properties index 779d997..d8cf6b5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,12 +1,12 @@ sonar.organization=saitho -sonar.projectKey=ts-appversion +sonar.projectKey=saitho_ts-appversion # ===================================================== # Meta-data for the project # ===================================================== sonar.links.homepage=https://github.com/saitho/ng-appversion -sonar.links.ci=https://travis-ci.com/saitho/ng-appversion +sonar.links.ci=https://github.com/saitho/ts-appversion/actions sonar.links.scm=https://github.com/saitho/ng-appversion sonar.links.issue=https://github.com/saitho/ng-appversion/issues From 197ce89e40053ade46d0a5989a616677ba12cd8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:17:10 +0000 Subject: [PATCH 2/2] chore(deps-dev): bump browserify-sign from 4.2.1 to 4.2.2 in /example Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2. - [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md) - [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.2.1...v4.2.2) --- updated-dependencies: - dependency-name: browserify-sign dependency-type: indirect ... Signed-off-by: dependabot[bot] --- example/package-lock.json | 53 ++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/example/package-lock.json b/example/package-lock.json index 538ad5a..85e3ac3 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -2427,26 +2427,55 @@ } }, "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "dev": true, "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" }, "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "requires": { "inherits": "^2.0.3",