From 40b3af51de9cea93fc2a5f069b24ad2606682c93 Mon Sep 17 00:00:00 2001 From: Wiktoria Kuna Date: Wed, 19 Jul 2023 08:48:27 +0200 Subject: [PATCH] Rework CI Remove environment-setup.sh script and delegate fetching dependencies to yml. --- .ci.yml | 27 ++++++++++++++++----------- .github/scripts/setup-environment.sh | 6 ------ .github/workflows/build.yml | 17 ++++++++++------- 3 files changed, 26 insertions(+), 24 deletions(-) delete mode 100755 .github/scripts/setup-environment.sh diff --git a/.ci.yml b/.ci.yml index 882d633..75690e3 100644 --- a/.ci.yml +++ b/.ci.yml @@ -1,12 +1,20 @@ image: $DOCKER_IMAGE -test: +.build_setup: &setup_env before_script: - - export DEBIAN_FRONTEND=noninteractive - # sudo is necessary for setup-enviroment.sh script - - apt --allow-releaseinfo-change update && apt install -y --no-install-recommends git build-essential sudo - - ./.github/scripts/setup-environment.sh + - export DEBIAN_FRONTEND=noninteractive + - apt --allow-releaseinfo-change update && apt install -y --no-install-recommends git build-essential make python3 python3-pip + - apt install -y --no-install-recommends apt-transport-https curl gnupg graphicsmagick-imagemagick-compat default-jdk default-jre + - echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list + - echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list + - curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add + - apt update && apt install -y sbt - git submodule update --init --recursive + - pip3 install -r docs/requirements.txt + +build-and-test: + <<: *setup_env + stage: build script: - make testall - mkdir out/ @@ -16,15 +24,12 @@ test: - out/ build-docs: + <<: *setup_env stage: build script: - - export DEBIAN_FRONTEND=noninteractive - - apt --allow-releaseinfo-change update && apt install -y --no-install-recommends git build-essential sudo - - sudo apt install -y --no-install-recommends make python3 python3-pip - - pip3 install -r docs/requirements.txt - SPHINXOPTS="-A conf_py_path=$DOCS_DIR/$SOURCEDIR/ -A commit=$CI_BUILD_REF -A branch=$CI_BUILD_REF_NAME" make html - make linkcheck - - cp docs/*.png build/html + - cp docs/*.png build/html - tar cf $CI_DOCS_ARCHIVE -C build/html/ . artifacts: paths: @@ -37,7 +42,7 @@ deploy-docs: dependencies: - build-docs stage: deploy - tags: ['docs'] + tags: ["docs"] script: echo 'Deploying docs' artifacts: paths: diff --git a/.github/scripts/setup-environment.sh b/.github/scripts/setup-environment.sh deleted file mode 100755 index 20c30e9..0000000 --- a/.github/scripts/setup-environment.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -sudo apt-get --allow-releaseinfo-change update && sudo apt-get install -y --no-install-recommends apt-transport-https curl gnupg graphicsmagick-imagemagick-compat graphicsmagick-imagemagick-compat default-jdk default-jre -echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list:wq -echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list -curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add -sudo apt-get update && sudo apt-get install -y sbt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0ba850..469a9eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,11 +6,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Test + - name: Build and test the design run: | - ./.github/scripts/setup-environment.sh - make testall - + export DEBIAN_FRONTEND=noninteractive + sudo apt --allow-releaseinfo-change update && sudo apt install -y --no-install-recommends apt-transport-https curl gnupg graphicsmagick-imagemagick-compat default-jdk default-jre + echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list + echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list + curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add + sudo apt update && sudo apt install -y sbt + make testall docs: runs-on: ubuntu-latest @@ -18,13 +22,12 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup environment + - name: Setup documentation environment run: | export DEBIAN_FRONTEND=noninteractive sudo apt update -qq sudo apt install -y make python3 python3-pip pip3 install -r docs/requirements.txt - - name: Build the documentation run: | @@ -32,7 +35,7 @@ jobs: make linkcheck cp docs/*.png build/html - - name: 'Upload artifact: Sphinx HTML' + - name: "Upload artifact: Sphinx HTML" uses: actions/upload-artifact@v3 with: name: Documentation-HTML