Skip to content

Commit

Permalink
chore: migrate to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
saitho committed Nov 29, 2023
1 parent efcbe83 commit b519f98
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 31 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -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 }}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit b519f98

Please sign in to comment.