diff --git a/.github/workflows/ce-dev-PR-test.yml b/.github/workflows/ce-dev-PR-test.yml index fefc9b2..7ff4137 100644 --- a/.github/workflows/ce-dev-PR-test.yml +++ b/.github/workflows/ce-dev-PR-test.yml @@ -5,7 +5,7 @@ on: pull_request jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install modules diff --git a/.github/workflows/ce-dev-build.yml b/.github/workflows/ce-dev-build.yml index 5bed936..6930607 100644 --- a/.github/workflows/ce-dev-build.yml +++ b/.github/workflows/ce-dev-build.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install modules diff --git a/.github/workflows/ce-dev-publish-docs.yml b/.github/workflows/ce-dev-publish-docs.yml index d7c0b3f..265c944 100644 --- a/.github/workflows/ce-dev-publish-docs.yml +++ b/.github/workflows/ce-dev-publish-docs.yml @@ -13,7 +13,7 @@ jobs: # Name the Job name: Publish documentation # Set the type of machine to run on - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: # Configures global Git variables for committing diff --git a/.github/workflows/ce-dev-test.yml b/.github/workflows/ce-dev-test.yml index 6258ef4..81aa1e1 100644 --- a/.github/workflows/ce-dev-test.yml +++ b/.github/workflows/ce-dev-test.yml @@ -6,8 +6,8 @@ on: - cron: '30 3 * * *' jobs: - build: - runs-on: ubuntu-20.04 + build-drupal9: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: @@ -36,4 +36,36 @@ jobs: run: | /bin/sh docker-images/export.sh --version latest --image-name ce-dev --dockerfile-path base /bin/sh docker-images/export.sh --version latest --image-name ce-dev-controller --dockerfile-path controller - /bin/sh templates/prebuild.sh + /bin/sh templates/prebuild.sh --projects "blank drupal9" + + build-drupal10: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: '1.x' + - name: Install modules + run: yarn + # Uses https://oclif.io/ + # Not strictly necessary here, but ensures the packing works + - name: Pack the JS + run: yarn oclif-dev pack + # We build mkcert from source because releases are broken + - name: Install test dependencies + run: | + sudo apt-get update + sudo apt-get install -y p7zip-full libnss3-tools wget + cd /tmp + wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz + sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz + export PATH=$PATH:/usr/local/go/bin + git clone https://github.com/FiloSottile/mkcert && cd mkcert + go build -ldflags "-X main.Version=$(git describe --tags)" + sudo mv ./mkcert /usr/local/bin && cd ../ + sudo chmod +x /usr/local/bin/mkcert + rm -Rf mkcert + - name: Build and test + run: | + /bin/sh docker-images/export.sh --version latest --image-name ce-dev --dockerfile-path base + /bin/sh docker-images/export.sh --version latest --image-name ce-dev-controller --dockerfile-path controller + /bin/sh templates/prebuild.sh --projects drupal10 diff --git a/templates/prebuild.sh b/templates/prebuild.sh index 29739fe..11f054c 100644 --- a/templates/prebuild.sh +++ b/templates/prebuild.sh @@ -1,7 +1,43 @@ #!/bin/sh # Test project creation and pre-build image. set -e + +usage(){ + echo 'prebuild.sh [OPTIONS]' + echo 'Test project creation and pre-build Docker images.' + echo '' + echo 'Available options:' + echo '--projects: space separated string of project types to build, defaults to all' + echo '--push: push images to the Docker registry' + echo '' +} + +# Parse options arguments. +parse_options(){ + while [ "${1:-}" ]; do + case "$1" in + "--projects") + shift + PROJECTS="$1" + ;; + "--push") + PUSH="true" + ;; + *) + usage + exit 1 + ;; + esac + shift + done +} + +# Set default variables. PROJECTS="blank drupal8 drupal9 drupal10" +PUSH="false" + +# Parse options. +parse_options "$@" # Common processing. OWN_DIR=$(dirname "$0") @@ -55,7 +91,7 @@ for PROJECT in $PROJECTS; do create_project "$PROJECT" test_project "$PROJECT" build_project "$PROJECT" - if [ -n "$1" ] && [ "$1" = "--push" ]; then + if [ "$PUSH" = "true" ]; then push_project "$PROJECT" fi done diff --git a/yarn.lock b/yarn.lock index 728ca4e..c9d0312 100644 --- a/yarn.lock +++ b/yarn.lock @@ -446,11 +446,11 @@ brace-expansion@^1.1.7: concat-map "0.0.1" braces@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" buffer-from@^1.0.0: version "1.1.1" @@ -1027,10 +1027,10 @@ file-entry-cache@^5.0.1: dependencies: flat-cache "^2.0.1" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1"