pinning oras version #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test action | |
on: | |
workflow_dispatch: | |
push: | |
branches: "main" | |
paths-ignore: | |
- .gitignore | |
- .gitattributes | |
- LICENSE | |
- README.md | |
- .github/** | |
- "!.github/workflows/test-action.yml" | |
pull_request: | |
paths-ignore: | |
- .gitignore | |
- .gitattributes | |
- LICENSE | |
- README.md | |
- .github/** | |
- "!.github/workflows/test-action.yml" | |
concurrency: ${{ github.workflow }} | |
jobs: | |
publish-test: | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: ./ | |
with: | |
path: test | |
image: ghcr.io/${{ github.repository }}/* | |
- uses: oras-project/setup-oras@v1 | |
- run: | | |
pushd "$(mktemp -d)" | |
oras manifest fetch ghcr.io/${{ github.repository }}/test:latest | jq | |
oras pull ghcr.io/${{ github.repository }}/test:latest | |
tree -a | |
tar -xvf devcontainer-feature-test.tgz | |
tree -a | |
jq '' devcontainer-feature.json | |
cat install.sh | |
- run: | | |
pushd "$(mktemp -d)" | |
oras manifest fetch ghcr.io/devcontainers/features/node:latest | jq | |
oras pull ghcr.io/devcontainers/features/node:latest | |
tree -a | |
tar -xvf devcontainer-feature-node.tgz | |
tree -a | |
jq '' devcontainer-feature.json | |
cat install.sh | |
use-test: | |
needs: publish-test | |
runs-on: ubuntu-latest | |
steps: | |
- run: npm install -g @devcontainers/cli | |
- run: | | |
set -ex | |
temp_dir=$(mktemp -d) | |
trap 'rm -rf "$temp_dir"' SIGINT SIGTERM ERR EXIT | |
pushd "$temp_dir" | |
mkdir -p .devcontainer | |
cat <<EOF | tee .devcontainer/devcontainer.json | |
{ | |
"image": "mcr.microsoft.com/devcontainers/base:debian", | |
"features": { | |
"ghcr.io/${{ github.repository }}/test": {} | |
} | |
} | |
EOF | |
tree -a | |
container_id=$(devcontainer up --workspace-folder . | jq -r .containerId) | |
docker kill "$container_id" |