Skip to content

fix: entrypoint.py

fix: entrypoint.py #87

Workflow file for this run

name: Continuous Integration
on:
pull_request:
push:
branches:
- main
paths-ignore:
- '.github/workflows/**'
- '**/*.md'
permissions:
contents: read
jobs:
build-and-push-docker:
name: Build and Push Docker
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5001:5000
env:
TEST_TAG: localhost:5001/actions/compress-decompress:latest
TEST_SOURCE: test3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v3
with:
install: true
driver-opts: network=host
- name: Build the Container
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.TEST_TAG }}
- name: Run the Container
env:
COMMAND: 'compress'
SOURCE: '${{ env.TEST_SOURCE }}'
FORMAT: 'zip'
# INCLUDEROOT: 'false'
run: |
docker run \
--env COMMAND="${{ env.COMMAND }}" \
--env SOURCE="${{ env.SOURCE }}" \
--env FORMAT="${{ env.FORMAT }}" \
--volume "${{ github.workspace }}:/usr/src" \
--rm ${{ env.TEST_TAG }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: compressed-data
path: ./${{ env.TEST_SOURCE }}.zip
test-action:
name: Test Extract Commit Action
runs-on: ubuntu-latest
needs: build-and-push-docker
env:
TEST_SOURCE: test3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test Local Compress Action
id: compress-decompress
uses: ./
with:
command: 'compress'
source: './test2'
format: 'tgz'
- name: List contents in the workspace
run: ls -la ${{ github.workspace }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: compressed-data-2
path: ./test2.tgz
- name: Print Output
run: |
echo "compress file path result: ${{ steps.compress-decompress.outputs.file_path }}"
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: compressed-data
- name: List contents in the workspace
run: ls -la ${{ github.workspace }}
- name: Test Local Decompress Action
uses: ./
with:
command: 'decompress'
source: '${{ env.TEST_SOURCE }}.zip'
format: 'zip'
dest: './unpacked'
- name: Display Content of the Unpacked Files
run: |
ls -la ${{ github.workspace }}/unpacked
ls -l ${{ github.workspace }}/unpacked/${{ env.TEST_SOURCE }}
# cat ${{ github.workspace }}/unpacked/${{ env.TEST_SOURCE }}.txt