build(deps): Bump codecov/codecov-action from 4 to 5 #2699
Workflow file for this run
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: Node & Docker | |
on: | |
push: | |
# Publish `master` as Docker `latest` image. | |
branches: | |
- main | |
- production | |
# Publish `v1.2.3` tags as releases. | |
tags: | |
- v* | |
# Run tests for any PRs. | |
pull_request: | |
branches: | |
- main | |
- production | |
env: | |
IMAGE_NAME: tell-me-everything-api | |
jobs: | |
build: | |
services: | |
mongodb: | |
image: mongo:8 | |
ports: | |
- 27017:27017 | |
env: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: testpassword | |
postgres: | |
image: postgres:13-alpine | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_PASSWORD: testpsqlpassword | |
POSTGRES_DB: tme | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
node-version: [20.x, 22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install | |
run: yarn --frozen-lockfile | |
- name: Lint | |
run: yarn lint | |
- name: Test | |
run: yarn test | |
- name: Build | |
run: yarn compile | |
- name: Codecov | |
uses: codecov/codecov-action@v5 | |
test-infra: | |
runs-on: ubuntu-24.04 | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 22.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- name: Install Dependencies | |
working-directory: ./infra | |
run: npm i | |
- name: Build | |
working-directory: ./infra | |
run: npm run build | |
docker-test: | |
runs-on: ubuntu-24.04 | |
needs: build | |
if: ${{ github.event_name == 'pull_request' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
run: docker build . | |
# Push image to GitHub Packages. | |
# See also https://docs.docker.com/docker-hub/builds/ | |
docker-push: | |
# Ensure test job passes before pushing image. | |
needs: build | |
runs-on: ubuntu-24.04 | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
bervproject/${{ env.IMAGE_NAME }} | |
ghcr.io/${{ github.repository }} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |