Merge pull request #310 from NethermindEth/main #33
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: "Build Importer" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: [importer] | |
workflow_dispatch: | |
env: | |
BUILD_CONFIG: release | |
DOTNET_VERSION: 8 | |
DOTNET_INSTALL_DIR: "~/.dotnet" | |
jobs: | |
tests: | |
timeout-minutes: 20 | |
name: "Run Paprika tests" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write # for sticky-pull-request-comment | |
strategy: | |
matrix: | |
os: [linux, win] | |
steps: | |
- name: Cache dotnet | |
id: cache-dotnet | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.DOTNET_INSTALL_DIR }} | |
key: ${{ runner.os }}-dotnet-${{ env.DOTNET_VERSION }} | |
restore-keys: ${{ runner.os }}-dotnet-${{ env.DOTNET_VERSION }} | |
- name: Set up .NET | |
if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Cache nuget | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
- name: Test | |
run: dotnet test src/Paprika.Tests -c ${{ env.BUILD_CONFIG }} --filter TestCategory\!~LongRunning | |
- name: Build Importer | |
run: dotnet build -c Release --runtime ${{ matrix.os }}-x64 src/Paprika.Importer/Paprika.Importer.csproj | |
- uses: actions/upload-artifact@v4 | |
with: | |
# Name of the artifact to upload. | |
# Optional. Default is 'artifact' | |
name: Paprika.Importer.${{ matrix.os }} | |
# A file, directory or wildcard pattern that describes what to upload | |
# Required. | |
path: ./src/Paprika.Importer/bin/Release/net8.0/${{ matrix.os }}-x64 | |
# The desired behavior if no files are found using the provided path. | |
# Available Options: | |
# warn: Output a warning but do not fail the action | |
# error: Fail the action with an error message | |
# ignore: Do not output any warnings or errors, the action does not fail | |
# Optional. Default is 'warn' | |
if-no-files-found: error | |
# Duration after which artifact will expire in days. 0 means using default retention. | |
# Minimum 1 day. | |
# Maximum 90 days unless changed from the repository settings page. | |
# Optional. Defaults to repository settings. | |
retention-days: 7 | |
# The level of compression for Zlib to be applied to the artifact archive. | |
# The value can range from 0 to 9. | |
# For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. | |
# Optional. Default is '6' | |
compression-level: 6 | |
# If true, an artifact with a matching name will be deleted before a new one is uploaded. | |
# If false, the action will fail if an artifact for the given name already exists. | |
# Does not fail if the artifact does not exist. | |
# Optional. Default is 'false' | |
overwrite: true |