d2e-ui/pa tests #13729
Workflow file for this run
This file contains hidden or 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: d2e-ui/pa tests | |
| on: | |
| pull_request: | |
| types: [opened, ready_for_review, reopened, synchronize] | |
| merge_group: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| pick_runner: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| random_runner: ${{ steps.shuffle.outputs.random_runner }} | |
| steps: | |
| - id: shuffle | |
| run: echo "random_runner=$(shuf -e ubuntu-22.04 ubuntu-24.04 | head -n 1)" >> "$GITHUB_OUTPUT" | |
| test-mri-frontend: | |
| needs: [pick_runner] | |
| runs-on: ${{ needs.pick_runner.outputs.random_runner }} | |
| defaults: | |
| run: | |
| working-directory: ./plugins/ui | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| # this might remove tools that are actually needed, | |
| # if set to "true" but frees about 6 GB | |
| tool-cache: true | |
| # all of these default to true, but feel free to set to | |
| # "false" if necessary for your workflow | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Check if vue files have changed | |
| uses: dorny/paths-filter@v3 | |
| id: check_vue_files_changed | |
| with: | |
| filters: | | |
| vue_mri_ui_lib_changed: | |
| - 'plugins/ui/apps/vue-mri-ui-lib/**' | |
| - '.github/workflows/ui-test-vue.yml' | |
| - name: Setup bun if vue files have changed | |
| uses: oven-sh/setup-bun@v2 | |
| if: github.ref_name == 'develop' || github.event_name == 'merge_group' || steps.check_vue_files_changed.outputs.vue_mri_ui_lib_changed == 'true' | |
| with: | |
| bun-version: 1.2.23 | |
| - name: Get bun cache directory path | |
| if: github.ref_name == 'develop' || github.event_name == 'merge_group' || steps.check_vue_files_changed.outputs.vue_mri_ui_lib_changed == 'true' | |
| id: bun-cache-dir-path | |
| run: echo "dir=$(bun pm cache)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| id: bun-cache # use this to check for `cache-hit` (`steps.bun-cache.outputs.cache-hit != 'true'`) | |
| if: github.ref_name == 'develop' || github.event_name == 'merge_group' || steps.check_vue_files_changed.outputs.vue_mri_ui_lib_changed == 'true' | |
| with: | |
| path: ${{ steps.bun-cache-dir-path.outputs.dir }} | |
| key: ${{ runner.os }}-bun-${{ hashFiles('./bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Run unit tests with | |
| if: github.ref_name == 'develop' || github.event_name == 'merge_group' || steps.check_vue_files_changed.outputs.vue_mri_ui_lib_changed == 'true' | |
| run: | | |
| bun install | |
| bunx nx run vue-mri:test:ci |