-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (78 loc) · 2.55 KB
/
features.yml
File metadata and controls
90 lines (78 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Features
on:
pull_request:
paths:
- 'images/features/**'
- '.github/workflows/features.yml'
push:
branches:
- master
paths:
- 'images/features/**'
- '.github/workflows/features.yml'
tags:
- 'features/*/v*'
env:
REGISTRY: ghcr.io
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Validate devcontainer-feature.json
run: |
for feature_dir in images/features/src/*/; do
if [ -f "${feature_dir}devcontainer-feature.json" ]; then
echo "Validating ${feature_dir}devcontainer-feature.json"
jq empty "${feature_dir}devcontainer-feature.json"
fi
done
- name: Lint install.sh scripts
run: |
find images/features/src -name "*.sh" -type f -exec shellcheck {} +
test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
feature: [agents]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22'
- name: Install devcontainer CLI
run: npm install -g @devcontainers/cli
- name: Test feature
run: |
devcontainer features test \
--features ${{ matrix.feature }} \
--base-image mcr.microsoft.com/devcontainers/base:ubuntu \
--project-folder ./images/features
publish:
needs: [lint, test]
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/features/'))
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Log in to Container Registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Features
uses: devcontainers/action@1082abd5d2bf3a11abccba70eef98df068277772 # v1
with:
publish-features: true
base-path-to-features: ./images/features/src
generate-docs: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}