-
Notifications
You must be signed in to change notification settings - Fork 0
feat: migrate optipy to rigetti-pyo3
#61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
774304a
b2051f9
0ccd0d6
128f353
ebe0022
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,88 +1,66 @@ | ||
| name: Rust Check | ||
|
|
||
| on: push | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check: | ||
| name: Cargo Check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
| - uses: taiki-e/install-action@v1 | ||
| with: | ||
| tool: cargo-hack@0.6.28,cargo-make | ||
| - run: cargo make check | ||
| clippy: | ||
| name: Clippy Lints | ||
| name: Run Checks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| components: clippy | ||
| override: true | ||
| - uses: taiki-e/install-action@v1 | ||
| with: | ||
| tool: cargo-hack@0.6.28,cargo-make | ||
| - run: cargo make clippy | ||
| - uses: actions/checkout@v5 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - uses: taiki-e/install-action@cargo-hack | ||
| - uses: taiki-e/install-action@cargo-deny | ||
| - uses: taiki-e/install-action@cargo-make | ||
|
|
||
| - name: Check Formatting | ||
| run: cargo fmt --all -- --check | ||
|
|
||
| - name: Run cargo deny | ||
| run: cargo make deny | ||
|
|
||
| - name: Run Clippy | ||
| run: cargo make clippy | ||
|
|
||
| deadlinks: | ||
| name: Cargo Deadlinks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
| - uses: taiki-e/install-action@v1 | ||
| - uses: actions/checkout@v5 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - uses: taiki-e/install-action@cargo-make | ||
| - uses: taiki-e/install-action@v2 | ||
| with: | ||
| tool: cargo-deadlinks,cargo-make | ||
| - run: cargo make deadlinks | ||
| deny: | ||
| name: Cargo Deny | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| checks: | ||
| - advisories | ||
| - bans licenses sources | ||
| tool: cargo-deadlinks | ||
| - run: cargo make --cwd rigetti-pyo3 deadlinks | ||
|
|
||
| # Prevent sudden announcement of a new advisory from failing ci: | ||
| continue-on-error: ${{ matrix.checks == 'advisories' }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: EmbarkStudios/cargo-deny-action@v1 | ||
| with: | ||
| command: check ${{ matrix.checks }} | ||
| msrv: | ||
| name: Cargo MSRV | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions-rs/toolchain@v1 | ||
| - uses: actions/checkout@v5 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - uses: taiki-e/install-action@cargo-hack | ||
| - uses: taiki-e/install-action@cargo-make | ||
| - uses: taiki-e/install-action@v2 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
| - uses: taiki-e/install-action@v1 | ||
| with: | ||
| tool: cargo-msrv,cargo-make | ||
| - run: cargo make msrv-verify | ||
| tool: cargo-msrv | ||
| - run: cargo make --cwd rigetti-pyo3 msrv-verify | ||
|
|
||
| test: | ||
| name: Cargo Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
| - uses: taiki-e/install-action@v1 | ||
| with: | ||
| tool: cargo-hack@0.6.28,cargo-make | ||
| - uses: actions/checkout@v5 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - uses: taiki-e/install-action@cargo-hack | ||
| - uses: taiki-e/install-action@cargo-make | ||
| - run: cargo make test | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,9 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| inputs: | ||
| type: | ||
|
|
@@ -16,24 +19,34 @@ on: | |
|
|
||
| jobs: | ||
| prepare-release: | ||
| if: ${{ ! (github.event_name == 'push' && contains(github.event.head_commit.message, 'prepare release [skip ci]' )) }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For readability, I would have preferred this, assuming it parses correctly if: ${{ github.event_name != 'push' || ! contains(github.event.head_commit.message, 'prepare release [skip ci]' ) }} |
||
| runs-on: ubuntu-latest | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.PAT }} | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.PAT }} | ||
| - name: Install Knope | ||
| uses: knope-dev/action@v1 | ||
| with: | ||
| version: 0.7.0 # Test before updating, breaking changes likely: https://github.com/knope-dev/action#install-latest-version | ||
| - run: | | ||
| git config --global user.name "${{ github.triggering_actor }}" | ||
| git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com" | ||
| - name: Prepare Prerelease | ||
| run: knope --prerelease-label rc release | ||
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.type == 'prerelease') | ||
| - name: Prepare Release | ||
| run: knope release | ||
| if: github.event_name == 'workflow_dispatch' | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config --global user.name "${{ github.triggering_actor }}" | ||
| git config --global user.email "${{ github.triggering_actor}}@users.noreply.github.com" | ||
|
|
||
| - name: Install Knope | ||
| uses: knope-dev/action@v2.1.0 | ||
| with: | ||
| version: 0.21.3 # Test before updating, breaking changes likely: https://github.com/knope-dev/action#install-latest-version | ||
|
|
||
| - name: Dry-run Release | ||
| run: knope release --verbose --dry-run | ||
| if: github.event_name == 'pull_request' | ||
|
|
||
| - name: Prepare Prerelease | ||
| run: knope release --verbose --prerelease-label=rc | ||
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.type == 'prerelease') | ||
|
|
||
| - name: Release | ||
| run: knope release --verbose | ||
| if: github.event_name == 'workflow_dispatch' && inputs.type == 'release' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| name: Publish Crates | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| description: "Manually publish release" | ||
|
|
||
| jobs: | ||
| publish-rigetti-pyo3: | ||
|
Comment on lines
+9
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't have applied at the time of the PR, but with Rust 1.90 we now have |
||
| if: ${{ github.event_name == 'workflow_dispatch' || startswith(github.event.release.tag_name, 'rigetti-pyo3/v') }} | ||
|
|
||
| runs-on: ubuntu-latest | ||
| name: Publish rigetti-pyo3 | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - run: | | ||
| cargo publish -p rigetti-pyo3 --locked --token ${{ secrets.CRATES_IO_TOKEN }} | ||
| publish-optipy: | ||
| if: ${{ github.event_name == 'workflow_dispatch' || startswith(github.event.release.tag_name, 'optipy/v') }} | ||
|
|
||
| runs-on: ubuntu-latest | ||
| name: Publish optipy | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - run: | | ||
| cargo publish -p optipy --locked --token ${{ secrets.CRATES_IO_TOKEN }} | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| /target | ||
| /Cargo.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not apply these to
optipyas well?