Skip to content

prettier

prettier #5

Workflow file for this run

name: Integration Tests
on: [pull_request, push]
permissions:
packages: write
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Install Dependencies
run: npm ci
- name: Check Format
run: npm run format:check
- name: Lint
run: npm run lint
- name: Test
run: npm run ci-test
- name: Build Tester
run: npm run ci-tester
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
needs: setup
concurrency:
group: integration-tests
strategy:
matrix:
tests:
- title: '1a - Single: Untagged'
purpose: 'Removes all untagged images (single arch)'
folder: 'single-untagged'
- title: '1b - Multi: Untagged'
purpose: 'Removes all untagged images (multi arch)'
folder: 'multi-untagged'
- title: '2a - Single: Tagged'
purpose: 'Removes images with specific tag (single arch)'
folder: 'single-tagged'
tags: 'uclibc-1.35,uclibc-1.36'
- title: '2b - Multi: Tagged'
purpose: 'Removes images with specific tag (multi arch)'
folder: 'multi-tagged'
tags: 'uclibc-1.35,uclibc-1.36'
- title: '3a - Single: Keep N Tagged'
purpose: 'Removes all but the newest 2 tagged images (single arch)'
folder: 'single-keep-n-tagged'
keep-n-tagged: 2
exclude-tags: dummy
- title: '3b - Multi: Keep N Tagged'
purpose: 'Removes all but the newest 2 tagged images (multi arch)'
folder: 'multi-keep-n-tagged'
keep-n-tagged: 2
exclude-tags: dummy
- title: '4a - Single: Keep N Untagged'
purpose:
'Removes all but the newest 2 untagged images (single arch)'
folder: 'single-keep-n-untagged'
keep-n-untagged: 2
- title: '4b - Multi: Keep N Untagged'
purpose: 'Removes all but the newest 2 untagged images (multi arch)'
folder: 'multi-keep-n-untagged'
keep-n-untagged: 2
- title: '5 - Dry-Run'
purpose: 'No packages are removed'
folder: 'dry-run'
dry-run: true
- title: '6 - Missing Digests'
purpose: 'Looks for missing digests'
folder: 'missing-images'
tags: 'uclibc-1.34'
steps:
- name: 'Starting Test: ${{ matrix.tests.title }}'
run: |
echo Purpose of test: ${{ matrix.tests.purpose }}
if [ -z "${{ matrix.tests.tags }}" ]; then
export TAGS=""
else
export TAGS="--tags ${matrix.tests.tags}"
fi
if [ -z "${{ matrix.tests.keep-n-tagged }}" ]; then
export KEEP_N_TAGGED=""
else
export KEEP_N_TAGGED="--keep-n-tagged ${matrix.tests.keep-n-tagged}"
fi
if [ -z "${{ matrix.tests.keep-n-untagged }}" ]; then
export KEEP_N_UNTAGGED=""
else
export KEEP_N_UNTAGGED="--keep-n-untagged ${matrix.tests.keep-n-untagged}"
fi
if [ -z "${{ matrix.tests.exclude-tags }}" ]; then
export EXCLUDE_TAGS=""
else
export EXCLUDE_TAGS="--exclude-tags ${matrix.tests.exclude-tags}"
fi
- name: ' > Priming Test Environment'
run: |
node citester/index.js --token ${{ secrets.GITHUB_TOKEN }} \
--directory tests/${{ matrix.tests.folder }} \
--mode prime
- name: ' > Running Workflow'
uses: ./
with:
tags: ${{ env.TAGS }}
keep_n_tagged: ${{ env.KEEP_N_TAGGED }}
keep_n_untagged: ${{ env.KEEP_N_UNTAGGED }}
exclude_tags: ${{ env.EXCLUDE_TAGS }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Test Results - Multi Tagged
run:
node citester/index.js --token ${{ secrets.GITHUB_TOKEN }} --directory
tests/multi-tagged --mode validate
- name: ' > Validating Outcome'
run: |
node citester/index.js --token ${{ secrets.GITHUB_TOKEN }} \
--directory tests/${{ matrix.tests.folder }} \
--mode validate
# # referrer/attestation tests
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# # attestation tagged test
# - name: Prime Test - Attestation Tagged
# run:
# node citester/index.js --token ${{ secrets.GITHUB_TOKEN }} --directory
# tests/attestation-tagged --mode prime
# - name: Build and push image
# id: push1
# uses: docker/build-push-action@v5.0.0
# with:
# context: tests/attestation-tagged
# file: tests/attestation-tagged/Dockerfile.image
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
# - name: Attest Image
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# subject-digest: ${{ steps.push1.outputs.digest }}
# push-to-registry: true
# - name: Run Test - Attestation Tagged
# uses: ./
# with:
# tags: ${{ env.TAGS }}
# keep_n_tagged: ${{ env.KEEP_N_TAGGED }}
# keep_n_untagged: ${{ env.KEEP_N_UNTAGGED }}
# exclude_tags: ${{ env.EXCLUDE_TAGS }}
# token: ${{ secrets.GITHUB_TOKEN }}