diff --git a/.github/workflows/pull-requests b/.github/workflows/pull-requests new file mode 100644 index 0000000..67104c0 --- /dev/null +++ b/.github/workflows/pull-requests @@ -0,0 +1,55 @@ +// caching: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows + +name: + +on: [push] + +jobs: + bootstrap: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'npm' + - name: Install dependencies + run: npm ci + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'npm' + - name: Test + run: npm test + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'npm' + - run: sudo apt-get install libjq1 jq bc + - run: npm coverage + - run: + name: Publish coverage on PR + command: | + export PATH="$PATH:~/.local/bin" + bash ./scripts/post-coverage-to-github.sh $GITHUB_HEAD_REF + + build-prod: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'npm' + - name: Build + run: npm build \ No newline at end of file