# This is more or less a copy of # https://github.com/mdn/content/blob/main/.github/workflows/pr-test.yml # but done in a way that it first checks out mdn/translated-content (or # fork of) and _then_ checks out mdn/content which has the relevant # CI related tooling. name: PR Test on: pull_request: branches: - main jobs: tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/checkout@v2 with: repository: mdn/content path: mdn/content - name: Setup Node.js environment uses: actions/setup-node@v2.1.4 with: node-version: "12" - name: Cache node_modules uses: actions/cache@v2.1.4 id: cached-node_modules with: path: | ${{ github.workspace }}/mdn/content/node_modules key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Install all yarn packages if: steps.cached-node_modules.outputs.cache-hit != 'true' working-directory: ${{ github.workspace }}/mdn/content run: | yarn --frozen-lockfile - uses: technote-space/get-diff-action@v4.0.5 id: git_diff_content with: PATTERNS: files/**/*.html SET_ENV_NAME: GIT_DIFF_CONTENT - name: Build changed content if: ${{ env.GIT_DIFF_CONTENT }} env: CONTENT_ROOT: ${{ github.workspace }}/mdn/content/files CONTENT_TRANSLATED_ROOT: ${{ github.workspace }}/files working-directory: ${{ github.workspace }}/mdn/content run: | echo ${{ env.GIT_DIFF_CONTENT }} # Some day, when our number of flaws have reached 0 we'll change # this to "*:error" which means the slightest flaw in the build # will break the build. # See https://github.com/mdn/yari/issues/715 export BUILD_FLAW_LEVELS="*:ignore" # Note, it might be interesting to explore building *some* # pages in a PR build if the diff doesn't have any index.html # files changed. # Instead of building the git diff, you build some known typical # folders that you know don't take too long and do cover a lot # of interesting macros etc. # This way, when an edit to the source code comes in, perhaps the # functional tests have a gap in them but actually building # real content exposes it. # Setting this to an empty string effectively means that the #