Skip to content

Merge pull request #20428 from joshrwolf/docker-cli-use-tags #11

Merge pull request #20428 from joshrwolf/docker-cli-use-tags

Merge pull request #20428 from joshrwolf/docker-cli-use-tags #11

Workflow file for this run

name: Wolfi OS Test World
on:
push:
branches: ["main"]
paths-ignore:
- "**.md"
- "**.txt"
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Test packages
if: github.repository == 'wolfi-dev/os'
strategy:
matrix:
include:
- arch: x86_64
runner: ubuntu-intel-64-cores
- arch: aarch64
runner: ubuntu-arm-64-cores
fail-fast: false
runs-on: ${{matrix.runner}}
permissions:
contents: read
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Setup Docker
run: |
# Add Docker's official GPG key:
sudo apt-get update -y
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER
sudo apt-get install acl
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
# this need to point to main to always get the latest action
- uses: wolfi-dev/actions/install-wolfictl@main # main
- name: "Set up environment and test"
run: |
set -x
set -e
set -o pipefail
mkdir -p ./packages/${{ matrix.arch }}
# Don't use ./packages or a local key since we're not using any local packages
wolfictl test \
--runner docker \
--repository-append https://packages.wolfi.dev/os \
--keyring-append https://packages.wolfi.dev/os/wolfi-signing.rsa.pub \
--arch ${{ matrix.arch }} \
--trace ./packages/${{ matrix.arch }}/trace.json
- name: Reset file permissions
run: sudo chown -R $(id -u):$(id -g) .
- name: Create an archive for uploading
if: ${{ always() }}
run: |
# Move logs so we can upload them separately.
mv ./packages/${{ matrix.arch }}/testlogs /tmp/testlogs
# Move trace so we can upload it separately.
mv ./packages/${{ matrix.arch }}/trace.json /tmp/trace.json
# Always run these steps for https://github.com/wolfi-dev/os/issues/8698
- if: ${{ always() }}
name: "Upload logs archive to GitHub Artifacts"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: logs-${{ matrix.arch }}
path: /tmp/testlogs/
if-no-files-found: warn
- if: ${{ always() }}
name: "Upload trace to GitHub Artifacts"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: trace-${{ matrix.arch }}
path: /tmp/trace.json
if-no-files-found: warn