Skip to content

Commit

Permalink
Add initial action config
Browse files Browse the repository at this point in the history
  • Loading branch information
mjyc committed Jun 6, 2023
1 parent 1609652 commit 7e95e9b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/devcontainer-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
TEST_ID="$1"
set -e

echo "Running Smoke Test"

# Build
export DOCKER_BUILDKIT=1
echo "(*) Installing @devcontainer/cli"
npm install -g @devcontainers/cli

echo "Building Dev Container"
ID_LABEL="test-container=${TEMPLATE_ID}"
devcontainer up --id-label ${ID_LABEL} --workspace-folder "${SRC_DIR}"

# Test
devcontainer exec --workspace-folder "${SRC_DIR}" --id-label ${ID_LABEL} /bin/sh -c 'set -e && echo hello'

# Clean up
docker rm -f $(docker container ls -f "label=${ID_LABEL}" -q)
rm -rf "${SRC_DIR}"
16 changes: 16 additions & 0 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "CI"
on:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout main
id: checkout_release
uses: actions/checkout@v3
- name: Devcontainer container smoke test
id: test_devcontainer
shell: bash
run: ./.github/workflows/devcontainer-test.sh

0 comments on commit 7e95e9b

Please sign in to comment.