Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Bioblaze committed Oct 23, 2024
1 parent 9bea297 commit 00ae55f
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Full Deployment
on:
repository_dispatch:
types: [test_workflows]

concurrency:
group: ci-test_workflows-runner
cancel-in-progress: true

jobs:
test-create:
name: Create
uses: ./.github/workflows/test/create-upload.yaml
test-verify:
needs: test-create
name: Test
uses: ./.github/workflows/test/download-verify.yaml
20 changes: 20 additions & 0 deletions .github/workflows/test/create-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Create and Upload Artifact

on:
workflow_dispatch:

jobs:
create-file:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Create a text file with "Hello World"
run: echo "Hello World" > hello.txt

- name: Upload hello.txt as an artifact
uses: actions/upload-artifact@v3
with:
name: hello-world-file
path: hello.txt
35 changes: 35 additions & 0 deletions .github/workflows/test/download-verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Download and Verify Artifact

on:
workflow_dispatch:
workflow_run:
workflows: ["Create and Upload Artifact"]
types:
- completed

jobs:
verify-file:
runs-on: ubuntu-latest
steps:
- name: Download artifact from previous workflow
uses: actions/download-artifact@v3
with:
name: hello-world-file
path: ./artifact

- name: Check if the file exists
run: |
if [ ! -f ./artifact/hello.txt ]; then
echo "File not found!"
exit 1
fi
- name: Verify file contents
run: |
FILE_CONTENT=$(cat ./artifact/hello.txt)
if [ "$FILE_CONTENT" != "Hello World" ]; then
echo "File contents do not match!"
exit 1
else
echo "File contents verified successfully: $FILE_CONTENT"
fi

0 comments on commit 00ae55f

Please sign in to comment.