generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (93 loc) · 2.97 KB
/
test.yaml
File metadata and controls
102 lines (93 loc) · 2.97 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
91
92
93
94
95
96
97
98
99
100
101
102
name: "CI - Test Features"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Validate devcontainer-feature.json files"
uses: devcontainers/action@v1
with:
validate-only: "true"
base-path-to-features: "./src"
test-debian:
needs: validate
name: "Test on Debian Linux"
runs-on: ubuntu-latest
strategy:
matrix:
features:
- rye
- cypress
- starship
steps:
- uses: actions/checkout@v4
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Generating Debian tests for '${{ matrix.features }}'"
run: devcontainer features test -f ${{ matrix.features }} -i debian:bookworm --preserve-test-containers
test-ubuntu:
needs: validate
name: "Test on Ubuntu Linux"
runs-on: ubuntu-latest
strategy:
matrix:
features:
- rye
- cypress
- playwright
- starship
steps:
- uses: actions/checkout@v4
- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
- name: "Generating Debian tests for '${{ matrix.features }}'"
run: devcontainer features test -f ${{ matrix.features }} -i ubuntu --preserve-test-containers
publish:
name: "Publish Features & Update Documentation"
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- test-ubuntu
- test-debian
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
packages: write
steps:
- uses: actions/checkout@v4
- name: "Publish Features"
uses: devcontainers/action@v1
with:
publish-features: "true"
base-path-to-features: "./src"
generate-docs: "true"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create PR for Documentation
id: push_image_info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global user.email github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
git config pull.rebase false
branch=automated-documentation-update-$GITHUB_RUN_ID
git checkout -b $branch
message='Automated documentation update'
# Add / update and commit
git add */**/README.md
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
gh pr create --title "$message" --body "$message"
fi