This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Hugo Masclet <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9e17202
commit 4e14972
Showing
6 changed files
with
33 additions
and
288 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 |
---|---|---|
@@ -1,99 +1,42 @@ | ||
name: Lint, Test, Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
sha: | ||
description: 'Github sha' | ||
required: true | ||
type: string | ||
ref: | ||
description: 'Github ref' | ||
required: true | ||
type: string | ||
tag_name: | ||
description: 'Github tag_name' | ||
type: string | ||
release_created: | ||
description: 'Github release_created' | ||
type: string | ||
pr_number: | ||
description: 'PR Number' | ||
type: string | ||
pull_request: | ||
branches: | ||
- 'main' | ||
- 'develop' | ||
push: | ||
branches: | ||
- 'main' | ||
- 'develop' | ||
|
||
env: | ||
CF_PROJECT_NAME: wallet-universalprofile-cloud | ||
CF_BASE_URL: wallet-universalprofile-cloud | ||
|
||
name: build artifacts | ||
jobs: | ||
install: | ||
name: Install | ||
outputs: | ||
node_version: ${{ steps.nodeversion.outputs.content }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout ${{ inputs.sha }} | ||
uses: actions/checkout@master | ||
with: | ||
ref: ${{ inputs.sha }} | ||
- name: Read .node-version | ||
id: nodeversion | ||
uses: juliangruber/[email protected] | ||
with: | ||
path: ./.node-version | ||
- name: 🎛 Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ steps.nodeversion.outputs.content }} | ||
cache: 'yarn' | ||
|
||
- name: ⚙️ Install | ||
run: yarn | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
needs: install | ||
if: ${{ inputs.release_created != 'true' }} | ||
name: Lint | ||
|
||
test: | ||
timeout-minutes: 60 | ||
runs-on: macos-latest | ||
steps: | ||
- name: 🛎️ Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: 🎛 Setup Node | ||
uses: actions/setup-node@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ needs.install.outputs.node_version }} | ||
node-version: '18.17.0' | ||
cache: 'yarn' | ||
|
||
- name: ⚙️ Install | ||
run: yarn | ||
- name: ⚙️ Install dependencies | ||
run: yarn install | ||
|
||
- name: 🎨 Lint JS | ||
- name: 🎨 Lint | ||
run: yarn lint | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
needs: install | ||
name: Tests | ||
|
||
steps: | ||
- name: Checkout ${{ inputs.sha }} | ||
uses: actions/checkout@master | ||
with: | ||
ref: ${{ inputs.sha }} | ||
- name: 🎛 Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ needs.install.outputs.node_version }} | ||
cache: 'yarn' | ||
- name: ⚙️ Install | ||
run: yarn | ||
|
||
- name: ⚙️ Install Playwright | ||
run: yarn playwright install --with-deps chromium | ||
- name: 🛠 Install Playwright Browsers | ||
run: npx playwright install --with-deps chromium | ||
|
||
- name: 🧪 Testing | ||
run: yarn test | ||
- name: 🎯 Run Playwright tests | ||
run: npx playwright test | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
|
@@ -103,23 +46,20 @@ jobs: | |
retention-days: 30 | ||
|
||
deploy: | ||
needs: | ||
- test | ||
- install | ||
runs-on: ubuntu-latest | ||
name: Deploy | ||
needs: test | ||
|
||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: | | ||
PR_NUMBER="${{ inputs.pr_number }}" | ||
PR_NUMBER="${{ github.event.number }}" | ||
if [ -n "$PR_NUMBER" ] | ||
then | ||
echo "branch_name=pr-${PR_NUMBER}" >> $GITHUB_OUTPUT | ||
echo "url=https://pr-${PR_NUMBER}.${{ env.CF_BASE_URL }}.pages.dev" >> $GITHUB_OUTPUT | ||
else | ||
if [ "${{ inputs.ref }}" = "refs/heads/develop" ] | ||
if [ "${{ github.ref }}" = "refs/heads/develop" ] | ||
then | ||
echo "branch_name=develop" >> $GITHUB_OUTPUT | ||
echo "url=https://develop.${{ env.CF_BASE_URL }}.pages.dev" >> $GITHUB_OUTPUT | ||
|
@@ -130,19 +70,18 @@ jobs: | |
id: extract_branch | ||
|
||
- name: 🛎️ Checkout | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🎛 Setup Node | ||
uses: actions/setup-node@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ needs.install.outputs.node_version }} | ||
node-version: '18.17.0' | ||
cache: 'yarn' | ||
|
||
- name: ⚙️ Install | ||
run: yarn | ||
- name: Install | ||
run: yarn install | ||
|
||
- name: 🏗️ Build | ||
- name: Build | ||
run: yarn run pages:build | ||
|
||
- name: 'Deploy release' | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.