Update babel monorepo to v7.24.7 #682
Workflow file for this run
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
name: Pipeline | |
## test | |
## ↗ ↘ | |
## Install → lint → sonarqube → deploy-production | |
## ↘ ↗ | |
## generate → deploy-preview → validate-pages | |
on: | |
push: | |
paths-ignore: | |
- 'LICENSE' | |
- 'README.md' | |
jobs: | |
install: | |
name: Install Dependencies | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Install dependencies | |
if: steps.cache-node-module.outputs.cache-hit != 'true' | |
run: yarn --frozen-lockfile | |
test: | |
name: Test | |
needs: [install] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Test the source code | |
run: yarn test:coverage | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: CodeCoverageResult | |
path: build/coverage | |
lint: | |
name: Lint | |
needs: [install] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Lint the source code | |
run: yarn lint | |
generate: | |
name: Generate | |
needs: [install] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Generate the static app | |
run: yarn generate | |
deploy-preview: | |
name: Deploy preview website | |
needs: [generate] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: amondnet/vercel-action@v25 | |
id: vercel-deployment | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required | |
github-token: ${{ secrets.GITHUB_TOKEN }} #Optional | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} #Required | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} #Required | |
vercel-project-name: cv-with-nuxt # INFO: remove when https://github.com/amondnet/vercel-action/issues/30 is close | |
outputs: | |
preview-url: ${{ steps.vercel-deployment.outputs.preview-url }} | |
sonarqube: | |
name: SonarQube | |
needs: [test, lint] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Download code coverage results | |
uses: actions/download-artifact@v3 | |
with: | |
name: CodeCoverageResult | |
path: build/coverage | |
- name: Setup SonarQube | |
uses: warchant/setup-sonar-scanner@v3 | |
- name: Get version | |
id: version | |
shell: bash | |
run: | | |
echo "::set-output name=version::$(git describe --tags --abbrev=0)" | |
- name: Run SonarQube | |
env: | |
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: sonar-scanner | |
-Dsonar.login=${{ secrets.SONAR_TOKEN }} | |
-Dsonar.organization=fabiencrassat-github | |
-Dsonar.host.url=https://sonarcloud.io/ | |
-Dsonar.projectKey=cv-with-nuxt | |
-Dsonar.projectVersion=${{ steps.version.outputs.version }} | |
- name: Get Sonar quality gate | |
run: node scripts/get_sonar_quality_gate.js https://${{ secrets.SONAR_TOKEN }}:@sonarcloud.io | |
validate-pages: | |
name: Validate pages | |
needs: [deploy-preview] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v2 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Validate the pages | |
run: yarn validate:pages ${{ needs.deploy-preview.outputs.preview-url }} | |
deploy-production: | |
name: Deploy production website | |
needs: [sonarqube, validate-pages] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: amondnet/vercel-action@v25 | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required | |
github-token: ${{ secrets.GITHUB_TOKEN }} #Optional | |
vercel-args: --prod | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} #Required | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} #Required | |
vercel-project-name: cv-with-nuxt # INFO: remove when https://github.com/amondnet/vercel-action/issues/30 is close |