Skip to content

Commit

Permalink
test ci - forcepublish
Browse files Browse the repository at this point in the history
  • Loading branch information
Apfelwurm committed Nov 10, 2023
1 parent 336d9f1 commit 410d5e9
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 65 deletions.
135 changes: 72 additions & 63 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,72 +23,72 @@ on:

jobs:

test_linux_x64:
runs-on: ubuntu-latest
if: ${{ !startsWith( github.event.pull_request.head.label, 'lan2play-weblate' ) }}
steps:
- name : machine echo github
env : { CONTENT : "${{ toJson(github) }}" }
run : "echo $CONTENT"
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ./sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v3
with:
path: ./sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: pwsh
run: |
New-Item -Path ./sonar/scanner -ItemType Directory
dotnet tool install dotnet-sonarscanner --tool-path ./sonar/scanner
- name: Update SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'false'
shell: pwsh
run: |
dotnet tool update dotnet-sonarscanner --tool-path ./sonar/scanner
- name: Restore dependencies
run: dotnet restore
- name: start sonarscanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./sonar/scanner/dotnet-sonarscanner begin /k:"Lan2Play_PugSharp" /o:"lan2play" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="./**/*.opencover.xml"
- name: dotnet build
run: dotnet build --no-restore
- name: dotnet test
run: dotnet test --no-build --no-restore --collect "XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: stop sonarscanner
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
# test_linux_x64:
# runs-on: ubuntu-latest
# if: ${{ !startsWith( github.event.pull_request.head.label, 'lan2play-weblate' ) }}
# steps:
# - name : machine echo github
# env : { CONTENT : "${{ toJson(github) }}" }
# run : "echo $CONTENT"
# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '17'
# - name: Setup .NET
# uses: actions/setup-dotnet@v3
# with:
# dotnet-version: 7.0
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Cache SonarCloud packages
# uses: actions/cache@v3
# with:
# path: ./sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
# - name: Cache SonarCloud scanner
# id: cache-sonar-scanner
# uses: actions/cache@v3
# with:
# path: ./sonar/scanner
# key: ${{ runner.os }}-sonar-scanner
# restore-keys: ${{ runner.os }}-sonar-scanner
# - name: Install SonarCloud scanner
# if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
# shell: pwsh
# run: |
# New-Item -Path ./sonar/scanner -ItemType Directory
# dotnet tool install dotnet-sonarscanner --tool-path ./sonar/scanner
# - name: Update SonarCloud scanner
# if: steps.cache-sonar-scanner.outputs.cache-hit != 'false'
# shell: pwsh
# run: |
# dotnet tool update dotnet-sonarscanner --tool-path ./sonar/scanner
# - name: Restore dependencies
# run: dotnet restore
# - name: start sonarscanner
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./sonar/scanner/dotnet-sonarscanner begin /k:"Lan2Play_PugSharp" /o:"lan2play" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="./**/*.opencover.xml"
# - name: dotnet build
# run: dotnet build --no-restore
# - name: dotnet test
# run: dotnet test --no-build --no-restore --collect "XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
# - name: stop sonarscanner
# if: always()
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: ./sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

build_linux_x64:
runs-on: ubuntu-latest
if: ${{ !startsWith( github.event.pull_request.head.label, 'lan2play-weblate' ) }}
needs:
- test_linux_x64
# needs:
# - test_linux_x64
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -110,8 +110,17 @@ jobs:
run: mkdir -p packagebuild/addons/counterstrikesharp/plugins/PugSharp
- name: install deps
run: sudo apt-get update && sudo apt-get install jq unzip -y

- name: get counterstrikesharp version
run: echo "CSSHARPVER=$(dotnet list PugSharp/PugSharp.csproj package --format json | jq -r '.projects[].frameworks[].topLevelPackages[] | select(.id == "CounterStrikeSharp.API") | .resolvedVersion' | sed 's|1.0.|v|g')" >> $GITHUB_ENV
- name: echo counterstrikesharp version
run: echo $CSSHARPVER
- name: get counterstrikesharp link
run: echo "CSSHARPlink=$(curl -s -L https://api.github.com/repos/roflmuffin/CounterStrikeSharp/releases/tags/$CSSHARPVER | jq -r '.assets.[] | select(.browser_download_url | test(\"with-runtime\")) | .browser_download_url'))" >> $GITHUB_ENV
- name: echo counterstrikesharp link
run: echo $CSSHARPlink
- name: get counterstrikesharp
run: "wget -q -O counterstrikesharp.zip $(curl -s -L -H \"Accept: application/vnd.github+json\" https://api.github.com/repos/roflmuffin/CounterStrikeSharp/releases/tags/$(dotnet list PugSharp/PugSharp.csproj package --format json | jq -r '.projects[].frameworks[].topLevelPackages[] | select(.id == \"CounterStrikeSharp.API\") | .resolvedVersion' | sed 's|1.0.|v|g') | jq -r '.assets.[] | select(.browser_download_url | test(\"with-runtime\")) | .browser_download_url') "
run: "wget -q -O counterstrikesharp.zip $CSSHARPlink"
- name: extract counterstrikesharp
run: unzip -o $(currentDir)/counterstrikesharp.zip -d packagebuild/
- name: copy package content
Expand Down
3 changes: 1 addition & 2 deletions Docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,4 @@ Indices and tables

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

* :ref:`search`

0 comments on commit 410d5e9

Please sign in to comment.