|
7 | 7 | type: string |
8 | 8 | required: false |
9 | 9 | default: ${{ github.ref || github.head_ref }} |
| 10 | + chromatic_enable: |
| 11 | + description: 'Enable Chromatic Tests' |
| 12 | + required: false |
| 13 | + type: boolean |
| 14 | + default: false |
| 15 | + node_run_webpack: |
| 16 | + description: "Flag to always run the webpack production build." |
| 17 | + type: boolean |
| 18 | + required: false |
| 19 | + default: false |
| 20 | + runs_on: |
| 21 | + type: string |
| 22 | + required: false |
| 23 | + default: "ubuntu-22.04" |
10 | 24 | secrets: |
11 | 25 | DATAVISYN_BOT_REPO_TOKEN: |
12 | 26 | required: false |
@@ -36,19 +50,28 @@ jobs: |
36 | 50 | contents: write |
37 | 51 | runs-on: ubuntu-22.04 |
38 | 52 | steps: |
39 | | - # checkout specific source repository |
40 | | - - uses: actions/checkout@v3 |
| 53 | + - name: Checkout source repository |
| 54 | + uses: actions/checkout@v4 |
41 | 55 | with: |
42 | 56 | ref: ${{ inputs.branch }} |
43 | | - token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work |
44 | | - # checkout this workflow repository to get actions |
45 | | - - uses: actions/checkout@v3 |
| 57 | + token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} |
| 58 | + fetch-depth: ${{ inputs.chromatic_enable && '0' || '1' }} |
| 59 | + - name: Checkout github-workflows |
| 60 | + uses: actions/checkout@v4 |
46 | 61 | with: |
47 | 62 | repository: datavisyn/github-workflows |
48 | 63 | ref: ${{ env.WORKFLOW_BRANCH }} |
49 | 64 | path: ./tmp/github-workflows |
50 | | - - uses: ./tmp/github-workflows/.github/actions/build-node |
| 65 | + - name: Build node |
| 66 | + uses: ./tmp/github-workflows/.github/actions/build-node |
51 | 67 | with: |
52 | 68 | node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }} |
53 | 69 | npm_registry: ${{ env.NPM_REGISTRY }} |
54 | | - github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} |
| 70 | + github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} |
| 71 | + run_webpack: ${{ inputs.node_run_webpack }} |
| 72 | + enable_cache: ${{ inputs.runs_on != 'self-hosted' }} |
| 73 | + - name: Run Chromatic |
| 74 | + if: ${{ inputs.chromatic_enable }} |
| 75 | + |
| 76 | + with: |
| 77 | + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} |
0 commit comments