ci: test something
Signed-off-by: Timothy Schenk <admin@rainote.dev>
This commit is contained in:
parent
3a24dabdf2
commit
9286c9fe98
2 changed files with 154 additions and 154 deletions
|
@ -3,8 +3,8 @@ run-name: ${{ gitea.actor }} is building the Server application
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- Wiki/**
|
- Wiki/**
|
||||||
- Benchmarks/**
|
- Benchmarks/**
|
||||||
|
@ -183,24 +183,24 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: https://github.com/actions/setup-dotnet@v3
|
uses: https://github.com/actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: |
|
dotnet-version: |
|
||||||
7.0
|
9.0
|
||||||
8.0
|
dotnet-quality: preview
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
dotnet restore
|
dotnet restore
|
||||||
echo "::add-path::$HOME/.dotnet/tools"
|
echo "::add-path::$HOME/.dotnet/tools"
|
||||||
- name: Install nuget-license
|
- name: Install nuget-license
|
||||||
run: dotnet tool install --global dotnet-project-licenses
|
run: dotnet tool install --global dotnet-project-licenses
|
||||||
- name: Export licenses
|
- name: Export licenses
|
||||||
run: dotnet-project-licenses -i . -u --projects-filter projects_ignore_licenses.json -m -j -e -f licenses
|
run: dotnet-project-licenses -i . -u --projects-filter projects_ignore_licenses.json -m -j -e -f licenses
|
||||||
- name: Upload licenses
|
- name: Upload licenses
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: licenses
|
name: licenses
|
||||||
path: licenses
|
path: licenses
|
||||||
retention-days: 31
|
retention-days: 31
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
name: PR Workflow
|
name: PR Workflow
|
||||||
run-name: ${{ gitea.actor }} PR related workflow
|
run-name: ${{ gitea.actor }} PR related workflow
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- Wiki/**
|
- Wiki/**
|
||||||
- Benchmarks/**
|
- Benchmarks/**
|
||||||
- .run/**
|
- .run/**
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
preprocess:
|
preprocess:
|
||||||
|
@ -13,158 +13,158 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
sanitized_branch_name: ${{ steps.sanitize.outputs.sanitized_branch_name }}
|
sanitized_branch_name: ${{ steps.sanitize.outputs.sanitized_branch_name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Sanitize branch name
|
- name: Sanitize branch name
|
||||||
id: sanitize
|
id: sanitize
|
||||||
run: echo "::set-output name=sanitized_branch_name::$(echo ${{ github.ref_name }} | sed 's/\//-/g')"
|
run: echo "::set-output name=sanitized_branch_name::$(echo ${{ github.ref_name }} | sed 's/\//-/g')"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: https://github.com/actions/setup-dotnet@v3
|
uses: https://github.com/actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
dotnet build Continuity.AuthServer -c Release
|
dotnet build Continuity.AuthServer -c Release
|
||||||
|
|
||||||
sbom-scan:
|
sbom-scan:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: https://github.com/actions/setup-dotnet@v3
|
uses: https://github.com/actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
dotnet restore
|
dotnet restore
|
||||||
echo "::add-path::$HOME/.dotnet/tools"
|
echo "::add-path::$HOME/.dotnet/tools"
|
||||||
- name: Setup Dependency Track Dependencies
|
- name: Setup Dependency Track Dependencies
|
||||||
run: |
|
run: |
|
||||||
dotnet tool install --global CycloneDX
|
dotnet tool install --global CycloneDX
|
||||||
- name: Generate SBOM
|
- name: Generate SBOM
|
||||||
run: |
|
run: |
|
||||||
dotnet CycloneDX Continuity.AuthServer/Continuity.AuthServer.csproj -o . -dgl
|
dotnet CycloneDX Continuity.AuthServer/Continuity.AuthServer.csproj -o . -dgl
|
||||||
- name: Upload SBOM
|
- name: Upload SBOM
|
||||||
uses: https://github.com/DependencyTrack/gh-upload-sbom@v2.0.1
|
uses: https://github.com/DependencyTrack/gh-upload-sbom@v2.0.1
|
||||||
with:
|
with:
|
||||||
apiKey: ${{ secrets.DEPENDENCY_TRACK_API_KEY }}
|
apiKey: ${{ secrets.DEPENDENCY_TRACK_API_KEY }}
|
||||||
serverHostname: ${{ secrets.DEPENDENCY_TRACK_URL }}
|
serverHostname: ${{ secrets.DEPENDENCY_TRACK_URL }}
|
||||||
projectName: ${{ secrets.DEPENDENCY_TRACK_PROJECT_NAME }}
|
projectName: ${{ secrets.DEPENDENCY_TRACK_PROJECT_NAME }}
|
||||||
autoCreate: true
|
autoCreate: true
|
||||||
# set projectversion to be the branch name
|
# set projectversion to be the branch name
|
||||||
projectVersion: ${{ github.ref_name }}
|
projectVersion: ${{ github.ref_name }}
|
||||||
bomFilename: ${{ github.workspace }}/bom.xml
|
bomFilename: ${{ github.workspace }}/bom.xml
|
||||||
|
|
||||||
container-build:
|
container-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
||||||
needs: [ build, preprocess ]
|
needs: [build, preprocess]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: https://github.com/actions/setup-dotnet@v3
|
uses: https://github.com/actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
# Add support for more platforms with QEMU (optional)
|
# Add support for more platforms with QEMU (optional)
|
||||||
# https://github.com/docker/setup-qemu-action
|
# https://github.com/docker/setup-qemu-action
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ github.server_url }}
|
registry: ${{ github.server_url }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Continuity.AuthServer/Dockerfile
|
file: Continuity.AuthServer/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}
|
tags: forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
- name: Build and push to latest
|
- name: Build and push to latest
|
||||||
if: github.ref_name == 'master'
|
if: github.ref_name == 'master'
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Continuity.AuthServer/Dockerfile
|
file: Continuity.AuthServer/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: forge.rainote.dev/${{ github.repository }}:latest
|
tags: forge.rainote.dev/${{ github.repository }}:latest
|
||||||
platforms: linux/amd64, linux/arm64
|
platforms: linux/amd64, linux/arm64
|
||||||
|
|
||||||
container-sbom-scan:
|
container-sbom-scan:
|
||||||
needs: [ container-build, preprocess ]
|
needs: [container-build, preprocess]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: https://github.com/actions/setup-dotnet@v3
|
uses: https://github.com/actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
global-json-file: global.json
|
global-json-file: global.json
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
dotnet restore
|
dotnet restore
|
||||||
echo "::add-path::$HOME/.dotnet/tools"
|
echo "::add-path::$HOME/.dotnet/tools"
|
||||||
- name: Setup Dependency Track Dependencies
|
- name: Setup Dependency Track Dependencies
|
||||||
run: |
|
run: |
|
||||||
mkdir ~/.docker
|
mkdir ~/.docker
|
||||||
curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sh -s --
|
curl -sSfL https://raw.githubusercontent.com/docker/sbom-cli-plugin/main/install.sh | sh -s --
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ github.server_url }}
|
registry: ${{ github.server_url }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
- name: Generate SBOM
|
- name: Generate SBOM
|
||||||
run: |
|
run: |
|
||||||
echo forge.rainote.dev/${{ github.repository }}
|
echo forge.rainote.dev/${{ github.repository }}
|
||||||
echo forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}
|
echo forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}
|
||||||
docker pull forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}
|
docker pull forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }}
|
||||||
docker sbom -D forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }} --format cyclonedx-json --output container-bom.json
|
docker sbom -D forge.rainote.dev/${{ github.repository }}:${{ needs.preprocess.outputs.sanitized_branch_name }} --format cyclonedx-json --output container-bom.json
|
||||||
- name: Upload SBOM
|
- name: Upload SBOM
|
||||||
uses: https://github.com/DependencyTrack/gh-upload-sbom@v2.0.1
|
uses: https://github.com/DependencyTrack/gh-upload-sbom@v2.0.1
|
||||||
with:
|
with:
|
||||||
apiKey: ${{ secrets.DEPENDENCY_TRACK_API_KEY }}
|
apiKey: ${{ secrets.DEPENDENCY_TRACK_API_KEY }}
|
||||||
serverHostname: ${{ secrets.DEPENDENCY_TRACK_URL }}
|
serverHostname: ${{ secrets.DEPENDENCY_TRACK_URL }}
|
||||||
projectName: ${{ secrets.DEPENDENCY_TRACK_PROJECT_NAME }}-container
|
projectName: ${{ secrets.DEPENDENCY_TRACK_PROJECT_NAME }}-container
|
||||||
autoCreate: true
|
autoCreate: true
|
||||||
# set projectversion to be the branch name
|
# set projectversion to be the branch name
|
||||||
projectVersion: ${{ github.ref_name }}
|
projectVersion: ${{ github.ref_name }}
|
||||||
bomFilename: ${{ github.workspace }}/container-bom.json
|
bomFilename: ${{ github.workspace }}/container-bom.json
|
||||||
|
|
||||||
generate-licences:
|
generate-licences:
|
||||||
needs: [ build, preprocess ]
|
needs: [build, preprocess]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
container: catthehacker/ubuntu:act-latest@sha256:5f2ff408985b10de9da4a8ea735b7f07d4f98c61608180ebb8964deb37f7580a
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: https://github.com/actions/setup-dotnet@v3
|
uses: https://github.com/actions/setup-dotnet@v3
|
||||||
with:
|
with:
|
||||||
dotnet-version: |
|
dotnet-version: |
|
||||||
7.0
|
9.0
|
||||||
8.0
|
dotnet-quality: preview
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
dotnet restore
|
dotnet restore
|
||||||
echo "::add-path::$HOME/.dotnet/tools"
|
echo "::add-path::$HOME/.dotnet/tools"
|
||||||
- name: Install nuget-license
|
- name: Install nuget-license
|
||||||
run: dotnet tool install --global dotnet-project-licenses
|
run: dotnet tool install --global dotnet-project-licenses
|
||||||
- name: Export licenses
|
- name: Export licenses
|
||||||
run: dotnet-project-licenses -i . -u --projects-filter projects_ignore_licenses.json -m -j -e -f licenses
|
run: dotnet-project-licenses -i . -u --projects-filter projects_ignore_licenses.json -m -j -e -f licenses
|
||||||
- name: Upload licenses
|
- name: Upload licenses
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: licenses
|
name: licenses
|
||||||
path: licenses
|
path: licenses
|
||||||
retention-days: 31
|
retention-days: 31
|
||||||
|
|
Loading…
Reference in a new issue