From 28eda7663eb0dbfd26a8e627ad21a457c8d7fd7b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 19 Jun 2020 21:46:33 -0700 Subject: [PATCH] ci: take another pass at updating apt --- .github/workflows/gen_ubuntu16.yml | 5 +---- .github/workflows/gen_ubuntu16_continuous.yml | 9 +-------- .github/workflows/gen_ubuntu16_tag.yml | 5 +---- .github/workflows/gen_ubuntu18.yml | 5 +---- .github/workflows/gen_ubuntu18_continuous.yml | 9 +-------- .github/workflows/gen_ubuntu18_tag.yml | 5 +---- ci/generate-workflows.py | 14 +++++++++----- 7 files changed, 15 insertions(+), 37 deletions(-) diff --git a/.github/workflows/gen_ubuntu16.yml b/.github/workflows/gen_ubuntu16.yml index 726219373..34ec8bda7 100644 --- a/.github/workflows/gen_ubuntu16.yml +++ b/.github/workflows/gen_ubuntu16.yml @@ -17,12 +17,9 @@ jobs: runs-on: "ubuntu-16.04" steps: - - name: "set APT to non-interactive" - shell: bash - run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" - name: "Update APT" shell: bash - run: "apt update" + run: "sudo -n apt update" - name: "Install git" shell: bash run: "sudo -n apt-get install -y git" diff --git a/.github/workflows/gen_ubuntu16_continuous.yml b/.github/workflows/gen_ubuntu16_continuous.yml index 222829de7..6172ffb95 100644 --- a/.github/workflows/gen_ubuntu16_continuous.yml +++ b/.github/workflows/gen_ubuntu16_continuous.yml @@ -13,18 +13,11 @@ jobs: runs-on: "ubuntu-16.04" steps: - - name: "set APT to non-interactive" - shell: bash - run: | - export BUILD_REASON=Schedule - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - - - name: "Update APT" shell: bash run: | export BUILD_REASON=Schedule - apt update + sudo -n apt update - name: "Install git" diff --git a/.github/workflows/gen_ubuntu16_tag.yml b/.github/workflows/gen_ubuntu16_tag.yml index 078f0caad..f6df18a8e 100644 --- a/.github/workflows/gen_ubuntu16_tag.yml +++ b/.github/workflows/gen_ubuntu16_tag.yml @@ -14,12 +14,9 @@ jobs: runs-on: "ubuntu-16.04" steps: - - name: "set APT to non-interactive" - shell: bash - run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" - name: "Update APT" shell: bash - run: "apt update" + run: "sudo -n apt update" - name: "Install git" shell: bash run: "sudo -n apt-get install -y git" diff --git a/.github/workflows/gen_ubuntu18.yml b/.github/workflows/gen_ubuntu18.yml index 1c9da41de..921ce0586 100644 --- a/.github/workflows/gen_ubuntu18.yml +++ b/.github/workflows/gen_ubuntu18.yml @@ -17,12 +17,9 @@ jobs: runs-on: "ubuntu-18.04" steps: - - name: "set APT to non-interactive" - shell: bash - run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" - name: "Update APT" shell: bash - run: "apt update" + run: "sudo -n apt update" - name: "Install git" shell: bash run: "sudo -n apt-get install -y git" diff --git a/.github/workflows/gen_ubuntu18_continuous.yml b/.github/workflows/gen_ubuntu18_continuous.yml index c425a19ea..52d17917c 100644 --- a/.github/workflows/gen_ubuntu18_continuous.yml +++ b/.github/workflows/gen_ubuntu18_continuous.yml @@ -13,18 +13,11 @@ jobs: runs-on: "ubuntu-18.04" steps: - - name: "set APT to non-interactive" - shell: bash - run: | - export BUILD_REASON=Schedule - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - - - name: "Update APT" shell: bash run: | export BUILD_REASON=Schedule - apt update + sudo -n apt update - name: "Install git" diff --git a/.github/workflows/gen_ubuntu18_tag.yml b/.github/workflows/gen_ubuntu18_tag.yml index 26549e02b..e39a7bfa1 100644 --- a/.github/workflows/gen_ubuntu18_tag.yml +++ b/.github/workflows/gen_ubuntu18_tag.yml @@ -14,12 +14,9 @@ jobs: runs-on: "ubuntu-18.04" steps: - - name: "set APT to non-interactive" - shell: bash - run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" - name: "Update APT" shell: bash - run: "apt update" + run: "sudo -n apt update" - name: "Install git" shell: bash run: "sudo -n apt-get install -y git" diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index f5c9d9033..157ff146a 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -399,12 +399,16 @@ cargo build --all --release""", def prep_environment(self): steps = [] if self.uses_apt(): + if self.container: + steps += [ + RunStep( + "set APT to non-interactive", + "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections", + ), + ] + sudo = "sudo -n " if self.needs_sudo() else "" steps += [ - RunStep( - "set APT to non-interactive", - "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections", - ), - RunStep("Update APT", "apt update"), + RunStep("Update APT", f"{sudo}apt update"), ] if self.container: if self.container == "centos:8":