Skip to content
Closed
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: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[alias]
regress = "run -p svd2rust-regress --"
44 changes: 43 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
TARGET: [x86_64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc]
TARGET:
[
x86_64-unknown-linux-gnu,
x86_64-apple-darwin,
x86_64-pc-windows-msvc,
]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -171,3 +176,40 @@ jobs:
uses: Swatinem/rust-cache@v2

- run: cargo fmt --all -- --check

artifact:
name: Build svd2rust artifact
if: github.event_name == 'pull_request'
needs: [check]
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
- target: aarch64-apple-darwin
runs-on: macos-latest
- target: x86_64-pc-windows-msvc
runs-on: windows-latest
suffix: .exe
steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: ${{ matrix.target }}

- name: Cache Dependencies
uses: Swatinem/rust-cache@v2

- name: Build svd2rust artifact
run: cargo build --release --target ${{ matrix.target }}

- run: mv target/${{ matrix.target }}/release/svd2rust${{ matrix.suffix || '' }} svd2rust-${{ matrix.target }}-$(git rev-parse --short HEAD)${{ matrix.suffix || '' }}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: artifact-svd2rust-${{ matrix.target }}
path: svd2rust-${{ matrix.target }}*
48 changes: 48 additions & 0 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Diff
on:
issue_comment:
types: [created]

jobs:
generate:
runs-on: ubuntu-latest
outputs:
diffs: ${{ steps.regress-ci.outputs.diffs }}
if: ${{ github.event.issue.pull_request }}
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Cache
uses: Swatinem/rust-cache@v2

- run: cargo regress ci
id: regress-ci
env:
GITHUB_COMMENT: ${{ github.event.comment.body }}
GITHUB_COMMENT_USER: ${{ github.event.comment.user }}
GITHUB_COMMENT_PR: ${{ github.event.comment.issue_url }}
diff:
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(needs.generate.outputs.diff) }}
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Cache
uses: Swatinem/rust-cache@v2

- uses: taiki-e/install-action@v2
if: matrix.needs_semver_checks
with:
tool: cargo-semver-checks

- run: cargo regress diff ${{ matrix.command }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.rs.bk
*.svd
target
ci/svd2rust-regress/Cargo.lock
Cargo.lock
output
Loading