Skip to content

Commit

Permalink
CI: use composite action for tdx dep installation
Browse files Browse the repository at this point in the history
To reduce duplucation among the workflows

Signed-off-by: Magnus Kulke <[email protected]>
  • Loading branch information
mkulke committed Oct 2, 2024
1 parent 097eb2d commit 414fac2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 24 deletions.
15 changes: 15 additions & 0 deletions .github/actions/install-intel-dcap/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Install Intel DCAP libraries'
inputs:
ubuntu-version:
required: true
runs:
using: "composite"
steps:
- name: Install TDX dependencies
id: install-tdx-dependencies
shell: bash
run: |
sudo curl -sL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg
sudo echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu ${{ inputs.ubuntu-version }} main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends libtdx-attest-dev
9 changes: 3 additions & 6 deletions .github/workflows/aa_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,9 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install TDX dependencies
run: |
sudo curl -sL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg
sudo echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends libtdx-attest-dev
- uses: ./.github/actions/install-intel-dcap
with:
ubuntu-version: jammy
if: matrix.instance == 'ubuntu-22.04'

- name: Install TPM dependencies
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/aa_cc_kbc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,9 @@ jobs:
override: true
components: rustfmt

- name: Install TDX dependencies
run: |
sudo curl -sL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg
sudo echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends libtdx-attest-dev
- uses: ./.github/actions/install-intel-dcap
with:
ubuntu-version: jammy

- name: Install TPM dependencies
run: |
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/image_rs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,9 @@ jobs:
run: |
sudo apt install -y clang llvm pkg-config nettle-dev protobuf-compiler libprotobuf-dev
- name: Install TDX dependencies
run: |
sudo curl -sL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg
sudo echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends libtdx-attest-dev
- uses: ./.github/actions/install-intel-dcap
with:
ubuntu-version: jammy
if: matrix.instance == 'ubuntu-latest'

- name: Install TPM dependencies
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/publish-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ jobs:
run: |
sudo apt-get install -y --no-install-recommends libtss2-dev
- name: Install tdx dependencies
- uses: ./.github/actions/install-intel-dcap
with:
ubuntu-version: jammy
if: matrix.tee == 'tdx'
run: |
sudo curl -sL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg
sudo echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends libtdx-attest-dev

- uses: actions/checkout@v4

Expand Down

0 comments on commit 414fac2

Please sign in to comment.