-
Notifications
You must be signed in to change notification settings - Fork 390
129 lines (124 loc) · 4.69 KB
/
dev-containers.yml
File metadata and controls
129 lines (124 loc) · 4.69 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Dev Containers CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
cli:
name: CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@microsoft'
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Type-Check
run: yarn type-check
- name: Lint
run: yarn lint
- name: Package
run: yarn package
- name: TGZ name
run: |
VERSION=$(jq -r '.version' < package.json)
echo "TGZ=devcontainers-cli-${VERSION}.tgz" | tee -a $GITHUB_ENV
echo "TGZ_UPLOAD=devcontainers-cli-${VERSION}-${GITHUB_SHA:0:8}.tgz" | tee -a $GITHUB_ENV
- name: Store TGZ
uses: actions/upload-artifact@v4
with:
name: ${{ env.TGZ_UPLOAD }}
path: ${{ env.TGZ }}
tests-matrix:
name: Tests Matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mocha-args: [
"src/test/container-features/containerFeaturesOrder.test.ts",
"src/test/container-features/e2e.test.ts",
"src/test/container-features/featuresCLICommands.test.ts",
"src/test/cli.build.test.ts",
"src/test/cli.exec.buildKit.1.test.ts",
"src/test/cli.exec.buildKit.2.test.ts",
"src/test/cli.exec.nonBuildKit.1.test.ts",
"src/test/cli.exec.nonBuildKit.2.test.ts",
"src/test/cli.podman.test.ts",
"src/test/cli.test.ts",
"src/test/cli.up.test.ts",
"src/test/imageMetadata.test.ts",
"src/test/container-features/containerFeaturesOCIPush.test.ts",
# Run all except the above:
"--exclude src/test/container-features/containerFeaturesOrder.test.ts --exclude src/test/container-features/registryCompatibilityOCI.test.ts --exclude src/test/container-features/containerFeaturesOCIPush.test.ts --exclude src/test/container-features/e2e.test.ts --exclude src/test/container-features/featuresCLICommands.test.ts --exclude src/test/cli.build.test.ts --exclude src/test/cli.exec.buildKit.1.test.ts --exclude src/test/cli.exec.buildKit.2.test.ts --exclude src/test/cli.exec.nonBuildKit.1.test.ts --exclude src/test/cli.exec.nonBuildKit.2.test.ts --exclude src/test/cli.podman.test.ts --exclude src/test/cli.test.ts --exclude src/test/cli.up.test.ts --exclude src/test/imageMetadata.test.ts 'src/test/**/*.test.ts'",
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@microsoft'
- name: Tools Info
run: |
docker info
docker buildx version
podman info
podman buildx version
- name: Install Dependencies
run: |
yarn install --frozen-lockfile
docker run --privileged --rm tonistiigi/binfmt --install all
- name: Type-Check
run: yarn type-check
- name: Package
run: yarn package
- name: Run Tests
run: yarn test-matrix --forbid-only ${{ matrix.mocha-args }}
env:
CI: true
features-registry-compatibility:
name: OCI Implementation Registry Compatibility
# TODO: This should be expanded to run on different platforms
# Most notably to test platform-specific credential helper behavior
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@microsoft'
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Type-Check
run: yarn type-check
- name: Package
run: yarn package
- name: Run Tests
run: yarn test-matrix --forbid-only src/test/container-features/registryCompatibilityOCI.test.ts
env:
CI: true
# This variable should only be set in the parent `devcontainers/cli` repo.
RUNNING_IN_DEVCONTAINERS_CLI_REPO_CI: ${{ vars.RUNNING_IN_DEVCONTAINERS_CLI_REPO_CI }}
# Scoped to read private packages in the `devcontainers` org (for testing purposes)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Pull-only credential for a test Azure CR instance
FEATURES_TEST__AZURE_REGISTRY_SCOPED_CREDENTIAL: ${{ secrets.FEATURES_TEST__AZURE_REGISTRY_SCOPED_CREDENTIAL }}
tests:
name: Tests
needs: [tests-matrix, features-registry-compatibility]
runs-on: ubuntu-latest
steps:
- name: Done
run: echo Test Matrix done.