Merge pull request #1540 from rodekruis/ci.precommit-lint #3466
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: 'Continuous Integration for IBF' | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
detect-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
ibf-api-service: ${{ steps.filter.outputs.ibf-api-service }} | |
ibf-dashboard: ${{ steps.filter.outputs.ibf-dashboard }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
ibf-api-service: | |
- "services/API-service/**" | |
ibf-dashboard: | |
- "interfaces/IBF-dashboard/**" | |
ibf-api-service: | |
needs: detect-changes | |
if: ${{ needs.detect-changes.outputs.ibf-api-service == 'true' }} | |
runs-on: ubuntu-latest | |
env: | |
SECRET: ${{ secrets.SECRET }} | |
MC_API: ${{ secrets.MC_API }} | |
strategy: | |
matrix: | |
node-version: [20.x] | |
defaults: | |
run: | |
working-directory: 'services/API-service' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci --no-audit | |
- run: npm run lint | |
- run: npm test | |
- run: docker build . --file Dockerfile --tag ibf-api-service:$(date +%s) | |
ibf-dashboard: | |
needs: detect-changes | |
if: ${{ needs.detect-changes.outputs.ibf-dashboard == 'true' }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
defaults: | |
run: | |
working-directory: 'interfaces/IBF-dashboard' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci --no-audit | |
- run: npm run lint | |
- run: npm test | |
- run: docker build . --file Dockerfile --tag ibf-dashboard:$(date +%s) | |
bump-version: | |
needs: [ibf-api-service, ibf-dashboard] | |
if: | | |
always() && | |
github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for previous workflow to complete | |
uses: softprops/turnstyle@v2 | |
with: | |
abort-after-seconds: 1800 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
- name: Bump version and push tag | |
uses: TriPSs/conventional-changelog-action@v5 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
git-message: 'chore(release): {version}' | |
release-count: 10 |