diff --git a/.github/workflows/artifacts-demo.yml b/.github/workflows/artifacts-demo.yml new file mode 100644 index 0000000..65556df --- /dev/null +++ b/.github/workflows/artifacts-demo.yml @@ -0,0 +1,77 @@ +name: Artifacts Demo + +on: + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: npm install + + - name: Run build + run: npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-files + path: dist/ + retention-days: 5 + + test: + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: npm install + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-files + path: dist/ + + - name: Run tests + run: npm run test:full-report + + - name: Upload coverage report + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-report + path: coverage/ + retention-days: 30 + + report: + runs-on: ubuntu-latest + needs: [build, test] + steps: + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-files + path: dist/ + + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + name: coverage-report + path: coverage/ + + - name: List build artifacts + run: ls -la dist/ + + - name: List coverage artifacts + run: ls -la coverage/ + + - name: Print success message + run: echo "Build and test artifacts successfully collected" +