diff --git a/.github/workflows/nodejs.yaml b/.github/workflows/nodejs.yaml new file mode 100644 index 0000000..119f8ba --- /dev/null +++ b/.github/workflows/nodejs.yaml @@ -0,0 +1,21 @@ +name: nodejs-app-test +on: + push: + workflow_dispatch: + +jobs: + echo-print: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '14' + - run: npm install + - run: npm test +# - run: npm run build + - uses: actions/upload-artifact@v3 + with: + name: build-artifact + path: build diff --git a/.github/workflows/pr-triggering.yaml b/.github/workflows/pr-triggering.yaml new file mode 100644 index 0000000..1f800a5 --- /dev/null +++ b/.github/workflows/pr-triggering.yaml @@ -0,0 +1,36 @@ +name: Pull Request Testing + +# Trigger the workflow on pull requests targeting specific branches +on: + pull_request: + branches: + - main # Target branch: main + - dev # Target branch: dev + +jobs: + test: + # Specify the type of machine to run the job + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout the repository code + - name: Checkout code + uses: actions/checkout@v3 + + # Step 2: Set up a specific programming language environment (example: Node.js) + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + # Step 3: Install dependencies + - name: Install dependencies + run: npm install + + # Step 4: Run tests + - name: Run tests + run: npm test + + # Step 5: Lint the code (optional step) + - name: Run linting + run: npm run lint diff --git a/README.md b/README.md new file mode 100644 index 0000000..038d718 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +testing