Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[*.sln]
end_of_line = crlf

[*]
end_of_line = lf
charset = utf-8
Expand Down
70 changes: 35 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,48 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
dotnet-version: 5.0.201
toolchain: stable
override: true
components: rustfmt, clippy

- name: Restore
run: dotnet restore
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: dotnet build --configuration Release --no-restore
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Unit Test
run: dotnet test --no-restore --verbosity normal
- name: Cache cargo build
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Package
run: dotnet pack -c release FileOptics/FileOptics.csproj
- name: Check formatting
run: cargo fmt -- --check

- name: Upload artifact from ubuntu
uses: actions/upload-artifact@v2
with:
name: package-${{matrix.os}}
path: "*.nupkg"
- name: Run clippy
run: cargo clippy -- -D warnings

publish:
if: startswith(github.ref, 'refs/heads/master')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: package-ubuntu-latest
- name: Build
run: cargo build --release

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.402
- name: Run tests
run: cargo test

- name: Publish
env:
FEED: "https://api.nuget.org/v3/index.json"
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push FileOptics*.nupkg --api-key "$NUGET_API_KEY" --source "$FEED"
- name: Upload artifact from ubuntu
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: file_optics-${{ matrix.os }}
path: target/release/file_optics
Loading