Merge pull request #115 from thunderstore-io/fix-actions-rate-limit #191
This file contains hidden or 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 & Test | |
| on: | |
| # Trigger on pushes to the main branch | |
| push: | |
| branches: [ master ] | |
| # Trigger on any pull request | |
| pull_request: | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For setup-rust | |
| jobs: | |
| pre-commit: | |
| name: Code style check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ref that triggered workflow | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8' | |
| - name: Setup Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.8' | |
| - name: Install pre-commit framework | |
| run: python -m pip install pre-commit | |
| - name: Install dotnet-format | |
| run: dotnet tool install -g dotnet-format | |
| - name: Run pre-commit | |
| run: pre-commit run --show-diff-on-failure --color=always --all-files | |
| build-and-test: | |
| name: Build and test ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macOS-latest] | |
| env: | |
| OS: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout ref that triggered workflow | |
| uses: actions/checkout@v4 | |
| - name: setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8' | |
| - name: Setup Cargo/Rust | |
| uses: moonrepo/setup-rust@v1 | |
| - name: Install dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Run xUnit tests | |
| run: dotnet test -p:EnableInstallers=false --collect:"XPlat Code Coverage" | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| directory: ./ThunderstoreCLI.Tests/TestResults/ | |
| env_vars: OS | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} |