From c46d129780a6de2cc228704621731ec5db399674 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Fri, 9 Jul 2021 16:26:55 -0400 Subject: build and upload built artifacts like mdn/content (#814) * build and upload built artifacts like mdn/content * remove {{languages}} macro call * hardcode upload path * use env var * debuggin * debuggin * debuggin * debuggin * debuggin * debugging rsync * debug more * debug more * cleanup * debugging * try this * try this * use 'HEAD~1' * try this * debug this * debug this * debug this * -l 1 * testing something * testing something (2) * testing something (3) * try git fetch -n origin * can git diff work now? * trying something more * trying something more (2) * trying something more (3) * try with the right working-directory * better sha? * fix a bunch of images in a Polish page --- .github/workflows/pr-test.yml | 101 +++++++++++++++------ .../1.5/using_firefox_1.5_caching/index.html | 6 -- .../how_does_the_internet_work/index.html | 16 ++-- 3 files changed, 81 insertions(+), 42 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index e7627ef857..45701450ac 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -17,6 +17,10 @@ jobs: steps: - uses: actions/checkout@v2 + # Needed otherswise it will check out a merge commit which means + # you can't get a `git diff` for this PR compared to its base. + # with: + # ref: ${{ github.event.pull_request.head.sha }} - uses: actions/checkout@v2 with: @@ -74,25 +78,18 @@ jobs: 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="unsafe_html: error, *: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. + + # This is so that if there's a single 'unsafe_html' flaw, it + # completely fails the build. + # But all other flaws should be 'warn' so that we can include + # information about the flaws when we analyze the built PR. + BUILD_FLAW_LEVELS: "unsafe_html: error, *:warn" + + # Because we build these pages in a way that you get a toolbar, + # so the flaws can be displayed, but we don't want any of the + # other toolbar features like "Fix fixable flaws" or "Quick-edit" + # we set this to disable that stuff. + REACT_APP_CRUD_MODE_READONLY: true # Setting this to an empty string effectively means that the #