Skip to content

[tests] Pin image to major version 0 #2641

[tests] Pin image to major version 0

[tests] Pin image to major version 0 #2641

Workflow file for this run

name: Dev Containers CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
cli:
name: CLI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.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@v2
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.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.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@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '16.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 ${{ 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@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '16.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.