Merge branch 'main' of https://github.com/h4570/armnas #51
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: CI | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
dotnet_angular: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup node.js environment | |
uses: actions/setup-node@v2.1.5 | |
with: | |
node-version: 20.x | |
- name: Install Angular | |
run: | | |
npm install @angular/cli -g | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v5.5 | |
with: | |
default_bump: patch | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build .NET | |
run: dotnet build --no-restore | |
# - name: Install Coveralls tool | |
# run: dotnet tool install --global coveralls.net | |
- name: Test .NET | |
run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=./lcov.info | |
working-directory: ./backend/OSCommanderTests/ | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./backend/OSCommanderTests/lcov.info | |
# - name: Upload coverage report | |
# run: csmacnz.Coveralls --opencover -i ./backend/OSCommanderTests/coverage.opencover.xml --repoToken $COVERALLS_TOKEN | |
# env: | |
# COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | |
- name: Build .NET (publish) | |
run: dotnet publish --no-restore -c Release /p:version=${{ steps.tag_version.outputs.new_version }} /p:build=$GITHUB_RUN_ID --output "./publish" | |
working-directory: ./backend/WebApi/ | |
- name: Install Angular dependencies | |
run: | | |
npm ci | |
working-directory: ./frontend/web-app | |
- name: Build Angular | |
run: | | |
export NODE_OPTIONS=--openssl-legacy-provider | |
ng build --configuration=production --output-hashing=all --output-path=./dist | |
working-directory: ./frontend/web-app | |
- name: Create .NET artifact (zip) | |
uses: TheDoctor0/zip-release@0.4.1 | |
with: | |
filename: web-api.zip | |
directory: ./backend/WebApi/publish | |
- name: Create Angular artifact (zip) | |
uses: TheDoctor0/zip-release@0.4.1 | |
with: | |
filename: web-app.zip | |
directory: ./frontend/web-app/dist | |
- name: Create a Release | |
uses: ncipollo/release-action@v1.8.4 | |
with: | |
artifacts: ./frontend/web-app/dist/web-app.zip,./backend/WebApi/publish/web-api.zip | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
token: ${{ secrets.GITHUB_TOKEN }} |