mrc-6097 Metadata endpoint #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-and-push, | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
test-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set Pull Request Head SHA | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
long_sha=${{ github.event.pull_request.head.sha }} | |
echo "PR_HEAD_SHA=${long_sha:0:7}" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- name: Install dependencies | |
run: npm ci | |
- name: Login to GHCR (GitHub Packages) | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build docker image | |
run: ./docker/build | |
- name: Push SHA docker image | |
run: ./docker/push | |
- name: Run app in docker | |
run: ./docker/run | |
- name: Run unit and integration tests with coverage | |
run: npm run coverage | |
- name: Upload coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true # optional (default = false) | |
files: ./coverage/coverage-final.json | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
- name: Push branch docker tag | |
run: ./docker/push_branch_tag | |