diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..6726550b2 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +name: CheckHomework + +on: [pull_request] + +jobs: + check: + if: contains(github.repository,'HackYourFuture') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: nelonoel/branch-name@v1 + - uses: actions/setup-node@v1 + with: + node-version: '10.x' + - run: npm install + - name: Echo week folder and run tests + run: | + echo ${{github.repository}} + echo ${{github.head_ref}} + declare WEEK + WEEK=$(echo "${{github.head_ref}}" | sed -E 's/.*w(eek)?[-_]?([0-9]).*/week\2/gi') + echo Week: "${WEEK}" + npm run test-"${WEEK}"