|
| 1 | +name: "Test" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + docs: |
| 12 | + name: "Ensure documentation has been generated" |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v6 |
| 16 | + |
| 17 | + - name: "Install devcontainer CLI" |
| 18 | + run: npm install -g @devcontainers/cli |
| 19 | + |
| 20 | + - name: "Generate docs" |
| 21 | + run: devcontainer features generate-docs -p src -n csutter/devcontainer-features |
| 22 | + |
| 23 | + - name: "Verify docs are up to date" |
| 24 | + run: git diff --quiet -- */**/README.md |
| 25 | + |
| 26 | + shellcheck: |
| 27 | + name: Shellcheck |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v6 |
| 31 | + |
| 32 | + - name: Run ShellCheck |
| 33 | + uses: ludeeus/action-shellcheck@2.0.0 |
| 34 | + |
| 35 | + test: |
| 36 | + name: "Test ${{ matrix.feature }} on ${{ matrix.baseImage }}" |
| 37 | + runs-on: ubuntu-latest |
| 38 | + continue-on-error: true |
| 39 | + strategy: |
| 40 | + matrix: |
| 41 | + feature: |
| 42 | + - personal-setup |
| 43 | + baseImage: |
| 44 | + # Vanilla distribution images |
| 45 | + - docker.io/library/debian:latest |
| 46 | + - docker.io/library/ubuntu:latest |
| 47 | + - quay.io/fedora/fedora-toolbox:latest |
| 48 | + # Microsoft devcontainer base image |
| 49 | + - mcr.microsoft.com/devcontainers/base:ubuntu |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + |
| 53 | + # The personal-setup feature requires my dotfiles folders to be present in the expected |
| 54 | + # location, so clone the public repo to simulate this, and fake the private repo mount. |
| 55 | + - name: "Prepare demo dotfiles mounts" |
| 56 | + run: | |
| 57 | + mkdir -p $HOME/src/csutter |
| 58 | + mkdir $HOME/src/csutter/dotfiles-private |
| 59 | + git clone https://github.com/csutter/dotfiles.git $HOME/src/csutter/dotfiles |
| 60 | +
|
| 61 | + - name: "Install devcontainer CLI" |
| 62 | + run: npm install -g @devcontainers/cli |
| 63 | + |
| 64 | + - name: "Test feature: ${{ matrix.feature }} on ${{ matrix.baseImage }}" |
| 65 | + run: devcontainer features test --features ${{ matrix.feature }} --base-image ${{ matrix.baseImage }} |
0 commit comments