From 8987bba0bac33b1052c810546b0971efa9fe1d8d Mon Sep 17 00:00:00 2001 From: tooniez Date: Wed, 28 Aug 2024 12:45:59 +0930 Subject: [PATCH] ci: add ci workflow --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4dde7a6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: Test and Publish Cucumber Report + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '14' + + - name: Install dependencies + run: npm ci + + - name: Run tests and generate Cucumber report + run: npm test + + - name: Generate Cucumber report + run: npm run generate:report + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: 'cucumber_report.html' + + - name: Deploy to GitHub Pages + if: github.ref == 'refs/heads/main' + id: deployment + uses: actions/deploy-pages@v2