Skip to content

Test e2e test #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,72 @@ env:
GO_VERSION: '1.21.12'

jobs:
setup:
# This job sets up the runners to be used in the matrix for the build workflow.
# It provides a list of available runners with stable, human-friendly names and a mapping
# from those names to the actual `runs-on` value for each runner type. This allows us to
# use codebuild-hosted runners for awslabs/soci-snapshotter without requiring forks to also
# have codebuild-hosted runners.
#
# If you want to use codebuild runners for your personal fork, follow the instructions to set
# up a codebuild project. https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html
# Then, replace 'soci-snapshotter-instance' with the name of the project you created.
name: Setup Build Matrix
runs-on: ubuntu-latest
strategy:
matrix:
# We're using a matrix with a single entry so that we can define some config as YAML rather than
# having to write escaped json in a string.
include:
- use-codebuild: ${{ github.repository_owner == 'awslabs' }}
runs-on-names-cb: [ubuntu-x86, al2-arm]
runs-on-names-gh: [ubuntu]
runner-labels:
ubuntu: ubuntu-22.04
ubuntu-x86: "codebuild-soci-snapshotter-instance-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large"
al2-arm: "codebuild-soci-snapshotter-instance-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large"
outputs:
available-runners: ${{ matrix.use-codebuild && toJSON(matrix.runs-on-names-cb) || toJSON(matrix.runs-on-names-gh) }}
runner-labels: ${{ toJSON(matrix.runner-labels) }}
steps:
- name: Dump Config
run: echo '${{ toJSON(matrix) }}'

test:
runs-on: ubuntu-20.04
needs: setup
runs-on: ${{ fromJSON(needs.setup.outputs.runner-labels)[matrix.os] }}
strategy:
matrix:
os: ${{ fromJSON(needs.setup.outputs.available-runners) }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install zlib static on AL2 ARM instances
if: matrix.os == 'al2-arm'
run: dnf install zlib-static.aarch64 -y
- run: make
- run: make test

integration:
runs-on: ubuntu-20.04
needs: setup
runs-on: ${{ fromJSON(needs.setup.outputs.runner-labels)[matrix.os] }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
containerd: ["1.6.33", "1.7.18", "2.0.0-rc.3"]
os: ${{ fromJSON(needs.setup.outputs.available-runners) }}
containerd: ["1.6.33", "1.7.18"]
env:
DOCKER_BUILD_ARGS: "CONTAINERD_VERSION=${{ matrix.containerd }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install zlib static on AL2 ARM instances
if: matrix.os == 'al2-arm'
run: dnf install zlib-static.aarch64 -y
- run: make integration
2 changes: 2 additions & 0 deletions integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
package integration

import (
"fmt"
"os"
"testing"

Expand Down Expand Up @@ -133,6 +134,7 @@ func setup() ([]func() error, error) {
compose.WithBuildArgs(buildArgs...),
compose.WithStdio(testutil.TestingLogDest()),
}
fmt.Println("compose", composeYaml)

return compose.Build(composeYaml, cOpts...)

Expand Down