Skip to content

Build

Build #174

Workflow file for this run

name: Build
on:
schedule:
- cron: "0 10 * * *" # everyday at 10am
pull_request:
branches: [ master ]
types: [ opened, synchronize, closed ]
push:
branches-ignore:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Fetch all tags and branches
run: git fetch --prune --unshallow
- uses: actions/[email protected]
with:
# need at least .NET 6 to build
dotnet-version: '6.0.400'
include-prerelease: true
- uses: actions/[email protected]
with:
# need at least .NET 7 to build
dotnet-version: '7.0.401'
include-prerelease: true
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.x
include-prerelease: true
- name: Cache Tools
uses: actions/cache@v3
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('build.cake') }}
- name: Build project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
uses: cake-build/[email protected]
with:
script-path: build.cake
target: SonarEnd
verbosity: Diagnostic
cake-version: 3.1.0
arguments: |
token: ${{ secrets.SONAR_TOKEN }}
mode: CI
- name: Copy integrate test files
uses: canastro/copy-file-action@master
with:
source: "tests/Cake.DependencyTrack.EndToEnd.Tests/docker/docker-compose.yml"
target: "artifact/docker-compose.yml"
- name: Copy integrate test files
uses: canastro/copy-file-action@master
with:
source: "tests/Cake.DependencyTrack.EndToEnd.Tests/build.cake"
target: "artifact/build.cake"
- uses: actions/upload-artifact@v3
with:
name: artifact
path: artifact
end-to-end-test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: artifact
path: artifact
- uses: actions/download-artifact@v3
with:
name: artifact
path: tests/Cake.DependencyTrack.EndToEnd.Tests
- name: Display structure of downloaded files
run: ls -R
working-directory: .
- uses: isbang/[email protected]
with:
compose-file: ./tests/Cake.DependencyTrack.EndToEnd.Tests/docker-compose.yml
- name: Make test call
run: curl -X GET http://localhost:8081/api/version
- name: Build project
uses: cake-build/[email protected]
with:
script-path: ./tests/Cake.DependencyTrack.EndToEnd.Tests/build.cake
verbosity: Diagnostic
cake-version: 3.1.0