From 1eb67047c90dba2be5d95f52baea22f1fccf7af8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 11 Mar 2022 13:00:56 +0000 Subject: [PATCH] Add some doc to the github actions / CI scripts (#8034) * Add some doc to the githuib actions / CI scripts Type: task * alalytics-events is more name matching --- .github/workflows/{develop.yml => end-to-end-tests.yaml} | 3 ++- .github/workflows/layered-build.yaml | 3 +++ .github/workflows/netlify.yaml | 2 ++ .github/workflows/test_coverage.yml | 1 + .github/workflows/typecheck.yaml | 1 + scripts/ci/Dockerfile | 2 ++ scripts/ci/install-deps.sh | 7 +++++++ scripts/ci/layered.sh | 7 +++++-- 8 files changed, 23 insertions(+), 3 deletions(-) rename .github/workflows/{develop.yml => end-to-end-tests.yaml} (95%) diff --git a/.github/workflows/develop.yml b/.github/workflows/end-to-end-tests.yaml similarity index 95% rename from .github/workflows/develop.yml rename to .github/workflows/end-to-end-tests.yaml index 456c97d580..334af1772f 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/end-to-end-tests.yaml @@ -1,4 +1,4 @@ -name: Develop +name: End-to-end Tests on: # These tests won't work for non-develop branches at the moment as they # won't pull in the right versions of other repos, so they're only enabled @@ -11,6 +11,7 @@ jobs: end-to-end: runs-on: ubuntu-latest env: + # This must be set for fetchdep.sh to get the right branch PR_NUMBER: ${{github.event.number}} container: vectorim/element-web-ci-e2etests-env:latest steps: diff --git a/.github/workflows/layered-build.yaml b/.github/workflows/layered-build.yaml index fd531fc968..1610f0e66e 100644 --- a/.github/workflows/layered-build.yaml +++ b/.github/workflows/layered-build.yaml @@ -1,3 +1,5 @@ +# Produce a 'layered build' (a build of element-web with this version of +# react-sdk) and output it as an artifact name: Layered Preview Build on: pull_request: @@ -5,6 +7,7 @@ jobs: build: runs-on: ubuntu-latest env: + # This must be set for fetchdep.sh to get the right branch PR_NUMBER: ${{github.event.number}} steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml index 7c472ab24d..864f029d1e 100644 --- a/.github/workflows/netlify.yaml +++ b/.github/workflows/netlify.yaml @@ -1,3 +1,5 @@ +# Triggers after the layered build has finished, taking the artifact +# and uploading it to netlify name: Upload Preview Build to Netlify on: workflow_run: diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index eb7a8aacd0..0a3dea0e82 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -7,6 +7,7 @@ jobs: test-coverage: runs-on: ubuntu-latest env: + # This must be set for fetchdep.sh to get the right branch PR_NUMBER: ${{github.event.number}} steps: - name: Checkout code diff --git a/.github/workflows/typecheck.yaml b/.github/workflows/typecheck.yaml index f6ab643958..60cabb3cab 100644 --- a/.github/workflows/typecheck.yaml +++ b/.github/workflows/typecheck.yaml @@ -6,6 +6,7 @@ jobs: build: runs-on: ubuntu-latest env: + # This must be set for fetchdep.sh to get the right branch PR_NUMBER: ${{github.event.number}} steps: - uses: actions/checkout@v2 diff --git a/scripts/ci/Dockerfile b/scripts/ci/Dockerfile index 447ed09b7c..08c9153578 100644 --- a/scripts/ci/Dockerfile +++ b/scripts/ci/Dockerfile @@ -1,3 +1,5 @@ +# Docker file for end-to-end tests + # Update on docker hub with the following commands in the directory of this file: # If you're on linux amd64 # docker build -t vectorim/element-web-ci-e2etests-env:latest . diff --git a/scripts/ci/install-deps.sh b/scripts/ci/install-deps.sh index 0741ad2ab3..c10884361e 100755 --- a/scripts/ci/install-deps.sh +++ b/scripts/ci/install-deps.sh @@ -1,5 +1,12 @@ #!/bin/bash +# This installs other Matrix dependencies that are often +# developed in parallel with react-sdk, using fetchdep.sh +# for branch matching. +# This will set up a working react-sdk environment, so is +# used for running react-sdk standalone tests. To set up a +# build of element-web, use layered.sh + set -ex scripts/fetchdep.sh matrix-org matrix-js-sdk diff --git a/scripts/ci/layered.sh b/scripts/ci/layered.sh index 3e30cc808f..8ebb7a7548 100755 --- a/scripts/ci/layered.sh +++ b/scripts/ci/layered.sh @@ -1,7 +1,9 @@ #!/bin/bash # Creates a layered environment with the full repo for the app and SDKs cloned -# and linked. +# and linked. This gives an element-web dev environment ready to build with +# the current react-sdk branch and any matching branches of react-sdk's dependencies +# so that changes can be tested in element-web. # Note that this style is different from the recommended developer setup: this # file nests js-sdk and element-web inside react-sdk, while the local @@ -16,7 +18,8 @@ yarn link yarn install --pure-lockfile popd -# Set up the js-sdk first +# Also set up matrix-analytics-events so we get the latest from +# the main branch or a branch with matching name scripts/fetchdep.sh matrix-org matrix-analytics-events main pushd matrix-analytics-events yarn link