Skip to content

📦 Add base image and initial features #2

📦 Add base image and initial features

📦 Add base image and initial features #2

Workflow file for this run

---
name: Features
on:
pull_request:
branches:
- main
paths:
- features/**
push:
branches:
- main
paths:
- features/**
permissions: {}
jobs:
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
features: ${{ steps.detect_changes.outputs.changes }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build path-filters file
id: build_path_filters
run: bash scripts/path-filter/configuration-generator.sh features
- name: Detect changes
id: detect_changes
uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
with:
filters: .github/path-filters/features.yml
test:
needs: [detect-changes]
if: ${{ needs.detect-changes.outputs.features != '[]' && github.ref != 'refs/heads/main' }}
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
feature: ${{ fromJson(needs.detect-changes.outputs.features) }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install @devcontainers/cli
id: install_devcontainers_cli
run: npm install --global @devcontainers/cli@latest
- name: Build Image
id: build_image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
file: images/base/Dockerfile
context: images/base
load: true
tags: ghcr.io/ministryofjustice/devcontainer-base:local-feature-test-${{ github.sha }}
- name: Testing ${{ matrix.feature }}
id: test_feature
run: |
devcontainer features test \
--skip-duplicated \
--skip-scenarios \
--project-folder features \
--features ${{ matrix.feature }} \
--base-image ghcr.io/ministryofjustice/devcontainer-base:local-feature-test-${{ github.sha }}
- name: Testing ${{ matrix.feature }} scenarios
id: test_feature_scenarios
run: |
devcontainer features test \
--project-folder features \
--features ${{ matrix.feature }} \
--skip-autogenerated \
--skip-duplicated \
--base-image ghcr.io/ministryofjustice/devcontainer-base:local-feature-test-${{ github.sha }}