mirror of
https://github.com/FoxxMD/multi-scrobbler.git
synced 2026-05-04 22:51:58 +00:00
ci: Implement test checks for PRs and image publishing
This commit is contained in:
parent
0efbe41b7e
commit
f231d4e1e4
3 changed files with 48 additions and 3 deletions
23
.github/workflows/publishImage.yml
vendored
23
.github/workflows/publishImage.yml
vendored
|
|
@ -12,9 +12,28 @@ on:
|
|||
- '**.md'
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to Docker Hub
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
- name: Install dev dependencies
|
||||
run: npm ci
|
||||
- name: Build Backend
|
||||
run: 'npm run build:backend'
|
||||
- name: Test Backend
|
||||
run: npm run test
|
||||
|
||||
push_to_registry:
|
||||
name: Build and push container images
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
|
|||
24
.github/workflows/test.yml
vendored
Normal file
24
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
name: Publish Docker image to Dockerhub
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '18.x'
|
||||
cache: 'npm'
|
||||
- name: Install dev dependencies
|
||||
run: npm ci
|
||||
- name: Build Backend
|
||||
run: 'npm run build:backend'
|
||||
- name: Test Backend
|
||||
run: npm run test
|
||||
Loading…
Add table
Add a link
Reference in a new issue