fix: only resolve direct methods in annotations and improve errors #869
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: CI | |
on: | |
push: | |
branches: [ "*.*.x" ] | |
pull_request: | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_TERM_COLOR: always | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
jobs: | |
lint: | |
name: Lint & test | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run cargo fmt | |
shell: pwsh | |
run: | | |
$rustfmt_output = cargo fmt --all --check -- --color always 2> $null | |
$rustfmt_exit_code = $LASTEXITCODE | |
if ($rustfmt_exit_code -ne 0 ) { | |
Write-Output "::error title=Rustfmt code formatting check failed::$(@( | |
"Code formatting error.", | |
" ", | |
"This project requires code to conform to the rustfmt style.", | |
"Please run ``cargo +nightly fmt --all`` before commiting." | |
) -join '%0A')" | |
Write-Output "" | |
Write-Output "Expand for details:" | |
Write-Output "::group::Detailed rustfmt error messages" | |
Write-Output $rustfmt_output | |
Write-Output "::endgroup::" | |
Write-Output "" | |
} | |
exit $rustfmt_exit_code | |
- run: cargo clippy -- -Dwarnings | |
- run: cargo build | |
- run: cargo test | |
build: | |
name: Build & upload artifacts | |
runs-on: windows-latest | |
env: | |
ARCHIVE_NAME: redscript-${{ github.ref_name }}.zip | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build and package the mod archive | |
run: .\resources\package.ps1 -stagingDir ${{ runner.temp }}/redscript-staging -archiveName ${{ env.ARCHIVE_NAME }} | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v3 | |
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
with: | |
path: | | |
${{ env.MOD_ARTIFACT_PATH }} | |
./target/release/redscript-cli.exe |