|
| 1 | +--- |
| 2 | +########################### |
| 3 | +########################### |
| 4 | +## Pull request testing ## |
| 5 | +########################### |
| 6 | +########################### |
| 7 | +name: Latest Pull Request |
| 8 | + |
| 9 | +# Documentation: |
| 10 | +# - Workflow: https://help.github.com/en/articles/workflow-syntax-for-github-actions |
| 11 | +# - SuperLinter: https://github.com/github/super-linter |
| 12 | +# - Markdown linter: https://github.com/DavidAnson/markdownlint |
| 13 | +# - Link validation: https://github.com/remarkjs/remark-validate-links |
| 14 | + |
| 15 | +###################################################### |
| 16 | +# Start the job on a pull request to the main branch # |
| 17 | +###################################################### |
| 18 | +on: pull_request |
| 19 | + |
| 20 | +############### |
| 21 | +# Set the Job # |
| 22 | +############### |
| 23 | +jobs: |
| 24 | + validate: |
| 25 | + # Set the agent to run on |
| 26 | + runs-on: ubuntu-latest |
| 27 | + |
| 28 | + ################## |
| 29 | + # Load all steps # |
| 30 | + ################## |
| 31 | + steps: |
| 32 | + ########################## |
| 33 | + # Checkout the code base # |
| 34 | + ########################## |
| 35 | + - name: Checkout Code |
| 36 | + uses: actions/checkout@v3 |
| 37 | + with: |
| 38 | + # Full git history is needed to get a proper list of changed files |
| 39 | + # within `super-linter` |
| 40 | + fetch-depth: 0 |
| 41 | + - run: cat ".github/super-linter.env" >> "$GITHUB_ENV" |
| 42 | + |
| 43 | + ################################ |
| 44 | + # Run Linters against code base # |
| 45 | + ################################ |
| 46 | + - name: Lint Code Base |
| 47 | + # |
| 48 | + # Use full version number to avoid cases when a next |
| 49 | + # released version is buggy |
| 50 | + # About slim image: https://github.com/github/super-linter#slim-image |
| 51 | + uses: github/super-linter/slim@v4.10.1 |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + DEFAULT_BRANCH: main |
| 55 | + VALIDATE_ALL_CODEBASE: false |
| 56 | + VALIDATE_GITHUB_ACTIONS: true |
| 57 | + |
| 58 | + - name: Setup Node v16 for Yarn v3 |
| 59 | + uses: actions/setup-node@v3 |
| 60 | + with: |
| 61 | + node-version: '16.15.1' # Current LTS version |
| 62 | + |
| 63 | + - name: Enable Corepack for Yarn v3 |
| 64 | + run: corepack enable |
| 65 | + |
| 66 | + - name: Install Yarn v3 |
| 67 | + uses: borales/actions-yarn@v3 |
| 68 | + with: |
| 69 | + cmd: set version stable |
| 70 | + |
| 71 | + - name: Install dependencies |
| 72 | + uses: borales/actions-yarn@v3 |
| 73 | + env: |
| 74 | + YARN_ENABLE_IMMUTABLE_INSTALLS: false |
| 75 | + with: |
| 76 | + cmd: install |
| 77 | + |
| 78 | + - name: Check internal links |
| 79 | + uses: borales/actions-yarn@v3 |
| 80 | + with: |
| 81 | + cmd: test:links |
| 82 | + |
| 83 | + - name: Build site |
| 84 | + if: ${{ success() }} |
| 85 | + uses: borales/actions-yarn@v3 |
| 86 | + with: |
| 87 | + cmd: build |
| 88 | + env: |
| 89 | + NODE_OPTIONS: "--max_old_space_size=4096" |
0 commit comments