use init struct pattern #287
Workflow file for this run
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: pr | |
on: | |
pull_request: | |
branches: [ "main" ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
changed-files: | |
name: changed-files | |
runs-on: ubuntu-latest | |
outputs: | |
src: ${{ steps.changed-files-yaml.outputs.src_any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: changed-files-yaml | |
uses: tj-actions/changed-files@v45 | |
with: | |
files_yaml: | | |
src: | |
- '**/*.rs' | |
- '**/Cargo.toml' | |
changed-files-miri: | |
name: changed-files-miri | |
runs-on: ubuntu-latest | |
outputs: | |
miri: ${{ steps.changed-files.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- run: python3 build.py util glob_unsafe | |
- id: changed-files | |
uses: tj-actions/changed-files@v45 | |
with: | |
files_from_source_file: filelist-for-miri-test.txt | |
test: | |
needs: changed-files | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
name: test-on-${{ matrix.os }}${{ matrix.arch && '-' }}${{ matrix.arch }}${{ matrix.features && '-' }}${{ matrix.features }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
no-example: true | |
lint: true | |
- os: windows-latest | |
arch: aarch64 | |
no-example: true | |
no-test: true | |
- os: macos-latest | |
no-example: true | |
lint: true | |
- os: ubuntu-latest | |
lint: true | |
- os: ubuntu-latest | |
arch: arm32 | |
no-example: true | |
no-test: true | |
- os: ubuntu-latest | |
arch: aarch64 | |
no-example: true | |
no-test: true | |
- os: ubuntu-latest | |
features: "use_meter left_handed" | |
lint: true | |
- os: ubuntu-latest | |
features: "async" | |
lint: true | |
- os: ubuntu-latest | |
features: "lightweight async-trait" | |
lint: true | |
- os: ubuntu-latest | |
features: "dynamic_freq" | |
lint: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: ./.github/actions/setup-build | |
with: | |
os: ${{ matrix.os }} | |
arch: ${{ matrix.arch }} | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: nextest | |
if: ${{ matrix.no-test != true }} | |
- run: python3 build.py build --arch "${{ matrix.arch }}" --features "${{ matrix.features }}" ${{ matrix.no-example && '--no-example' }} | |
- run: python3 build.py test --features "${{ matrix.features }}" | |
if: ${{ matrix.no-test != true }} | |
- run: python3 build.py lint --features "${{ matrix.features }}" ${{ matrix.no-example && '--no-example' }} | |
if: ${{ matrix.lint == true }} | |
all-tests-passed: | |
if: ${{ always() }} | |
name: all-tests-passed | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- if: ${{ needs.test.result == 'failure' || needs.test.result == 'cancelled' }} | |
run: exit 1 | |
miri: | |
needs: changed-files-miri | |
if: ${{ needs.changed-files-miri.outputs.miri == 'true' }} | |
name: test-with-miri | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: ./.github/actions/setup-build | |
with: | |
os: ubuntu-latest | |
toolchain: nightly | |
components: miri | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: nextest | |
- run: | | |
python3 build.py test --miri | |
build-docs: | |
needs: changed-files | |
if: ${{ needs.changed-files.outputs.src == 'true' }} | |
name: build-docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: ./.github/actions/setup-build | |
with: | |
os: ubuntu-latest | |
toolchain: nightly | |
- run: python3 build.py doc | |
- uses: dtolnay/install@cargo-docs-rs | |
- run: | | |
cargo +nightly docs-rs -pautd3 | |
cargo +nightly docs-rs -pautd3-core | |
cargo +nightly docs-rs -pautd3-derive | |
cargo +nightly docs-rs -pautd3-driver | |
cargo +nightly docs-rs -pautd3-firmware-emulator | |
cargo +nightly docs-rs -pautd3-gain-holo | |
cargo +nightly docs-rs -pautd3-link-simulator | |
cargo +nightly docs-rs -pautd3-link-twincat | |
cargo +nightly docs-rs -pautd3-modulation-audio-file | |
cargo +nightly docs-rs -pautd3-protobuf | |
auto-merge: | |
needs: | |
- all-tests-passed | |
- miri | |
- build-docs | |
permissions: | |
pull-requests: write | |
contents: write | |
runs-on: ubuntu-latest | |
if: ${{ always() && !cancelled() && !failure() && github.actor == 'dependabot[bot]' }} | |
steps: | |
- run: gh pr merge --rebase --auto "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |