Change tool name from dotnet-fsharplint to fslint #1769
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| # to execute once a day (more info see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule ) | |
| schedule: | |
| - cron: '0 0 * * *' | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - '**' | |
| jobs: | |
| buildAndTest: | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macOS-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: make | |
| - name: Run tests | |
| run: make check | |
| - name: Run FSharpLint on itself | |
| run: make selfcheck | |
| testToolInvocation: | |
| needs: buildAndTest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| global-json-file: global.json | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: Restore tools | |
| run: dotnet tool restore | |
| - name: Build and pack | |
| run: dotnet fsi build.fsx -t Pack | |
| - name: Remove global.json to allow using .NET 10 SDK (for dnx) | |
| run: rm --force global.json | |
| - name: Run fsharplint as tool using dnx | |
| run: dnx fslint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj --source ./out/ --prerelease --yes --interactive false | |
| packReleaseBinaries: | |
| needs: buildAndTest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| # we need fetch-depth: 0 because we use the `git describe` command in build.fsx | |
| fetch-depth: 0 | |
| - name: Restore tools | |
| run: dotnet tool restore | |
| - name: Build | |
| run: dotnet fsi build.fsx | |
| - name: Pack | |
| run: dotnet fsi build.fsx -t Pack | |
| - name: Publish binaries as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries | |
| path: ./out/*.nupkg | |
| publishReleaseBinaries: | |
| needs: | |
| - packReleaseBinaries | |
| - testReleaseBinariesInDotNet8Container | |
| - testReleaseBinariesWithDotNet10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore tools | |
| run: dotnet tool restore | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: binaries | |
| path: ./out/ | |
| - name: Get Changelog Entry | |
| id: changelog_reader | |
| uses: mindsers/changelog-reader-action@v1 | |
| with: | |
| version: ${{ github.ref }} | |
| path: ./CHANGELOG.md | |
| - name: Upload binaries to nuget (if nugetKey present) | |
| env: | |
| nuget-key: ${{ secrets.NUGET_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: dotnet fsi build.fsx -t Push | |
| - name: Create Release (if tag) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| id: create_release | |
| uses: actions/create-release@latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: ${{ github.ref }} | |
| body: ${{ steps.changelog_reader.outputs.log_entry }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload binaries to release (if tag) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: out/*.nupkg | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| file_glob: true | |
| deployReleaseDocs: | |
| needs: publishReleaseBinaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Restore tools | |
| run: dotnet tool restore | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Run Fornax | |
| run: make docs | |
| - name: Deploy (if tag) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| personal_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs/_public | |
| publish_branch: gh-pages | |
| force_orphan: true | |
| testReleaseBinariesInDotNet8Container: | |
| needs: packReleaseBinaries | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/dotnet/sdk:8.0 | |
| steps: | |
| - name: List .NET SDKs | |
| run: dotnet --list-sdks | |
| - uses: actions/checkout@v4 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: binaries | |
| path: ./artifacts | |
| - name: Remove global.json to allow .NET 8 SDK | |
| run: rm -f global.json | |
| - name: Create local NuGet.config | |
| run: | | |
| cat > NuGet.config <<EOF | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <packageSources> | |
| <add key="local" value="./artifacts" /> | |
| </packageSources> | |
| <disabledPackageSources> | |
| <add key="nuget.org" value="true" /> | |
| </disabledPackageSources> | |
| </configuration> | |
| EOF | |
| - name: Install FSharpLint from downloaded binaries | |
| run: dotnet tool install --global fslint --prerelease --framework net8.0 | |
| - name: Add .NET tools to PATH | |
| run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH | |
| - name: Lint FSharpLint.Console project (net8.0 only) | |
| run: fslint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj --framework net8.0 | |
| testReleaseBinariesWithDotNet10: | |
| needs: packReleaseBinaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: List .NET SDKs | |
| run: dotnet --list-sdks | |
| - uses: actions/checkout@v4 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: binaries | |
| path: ./artifacts | |
| - name: Remove global.json to allow .NET 10 SDK | |
| run: rm -f global.json | |
| - name: Create local NuGet.config | |
| run: | | |
| cat > NuGet.config <<EOF | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <configuration> | |
| <packageSources> | |
| <add key="local" value="./artifacts" /> | |
| </packageSources> | |
| <disabledPackageSources> | |
| <add key="nuget.org" value="true" /> | |
| </disabledPackageSources> | |
| </configuration> | |
| EOF | |
| - name: Install FSharpLint from downloaded binaries | |
| run: dotnet tool install --global fslint --prerelease | |
| - name: Add .NET tools to PATH | |
| run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH | |
| - name: Lint FSharpLint.Console project | |
| run: fslint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj |