diff --git a/.github/workflows/build-and-test-workflow.yml b/.github/workflows/build-and-test-workflow.yml new file mode 100644 index 000000000..d5ae49bfb --- /dev/null +++ b/.github/workflows/build-and-test-workflow.yml @@ -0,0 +1,47 @@ +name: Build and Test + +on: + workflow_call: + inputs: + username: + description: 'A username passed from the caller workflow' + default: 'some software dev' + required: false + type: string + +jobs: + print-username: + runs-on: ubuntu-latest + + steps: + - name: Print the input name to STDOUT + run: echo The username is ${{ inputs.username }} + test: + # Similar to docker, we set up a virtual machine to run our tests + runs-on: ubuntu-latest + + steps: + # Each step has a name, some code, and some options + - name: Checkout Repository + uses: actions/checkout@v4 # This is a reference to some code to run + + # This step installs the Node version we want + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + # This step installs pip, pipenv, and our dependencies + - name: Install Dependencies + run: npm install + + - name: Start MongoDB + uses: supercharge/mongodb-github-action@1.10.0 + with: + mongodb-version: 5.0 + + # Now we run our tests + - name: Test with Jest, Cypress + uses: cypress-io/github-action@v6 + with: + start: npm run start:test diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml new file mode 100644 index 000000000..6bf9a79d2 --- /dev/null +++ b/.github/workflows/on-push.yml @@ -0,0 +1,10 @@ +name: Run Build & Test + +on: + push: + +jobs: + run-build-and-test: + uses: ./.github/workflows/build-and-test-workflow.yml + +