From a264d6d37dee2299958dc5707d818f36404879b5 Mon Sep 17 00:00:00 2001 From: bill fumerola Date: Fri, 23 May 2025 09:13:34 -0700 Subject: [PATCH 1/2] feature(gha): add github action --- .github/workflows/devenv.yaml | 40 +++++++++++++++++++++++++++++++++++ .github/workflows/push.yaml | 17 +++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/devenv.yaml create mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/devenv.yaml b/.github/workflows/devenv.yaml new file mode 100644 index 0000000..6c5170f --- /dev/null +++ b/.github/workflows/devenv.yaml @@ -0,0 +1,40 @@ +name: devenv workflow +on: + workflow_call: + inputs: + devenv-target: + required: true + type: string + +jobs: + test: + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + - name: Sccache Action + uses: Mozilla-Actions/sccache-action@main + - name: Run sccache stat for check + shell: bash + run: ${SCCACHE_PATH} --show-stats + - name: Set up cargo cache + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: install devenv + run: nix profile install nixpkgs#devenv + - name: run devenv target + run: devenv ${{ inputs.devenv-target }} diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..66661a1 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,17 @@ +name: pushes and pull requests +on: + pull_request: + +concurrency: + group: ci-${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + id-token: write + +jobs: + devenv-test: + uses: ./.github/workflows/devenv.yaml + with: + devenv-target: test --log-format tracing-pretty From d8e8a6a7c92d1e513375163f07314f39b3f08cbe Mon Sep 17 00:00:00 2001 From: bill fumerola Date: Thu, 22 May 2025 15:18:09 -0700 Subject: [PATCH 2/2] fix formatting --- src/path.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/path.rs b/src/path.rs index e55dd03..2ab65ae 100644 --- a/src/path.rs +++ b/src/path.rs @@ -10,18 +10,14 @@ pub struct ForeignInterfacePath { } impl ForeignInterfacePath { - pub fn new( - package_name: String, - interface_name: String, - version: Option, - ) -> Self { + pub fn new(package_name: String, interface_name: String, version: Option) -> Self { ForeignInterfacePath { package_name, interface_name, version, } } - + pub fn package_name(&self) -> &str { self.package_name.as_ref() } @@ -64,7 +60,7 @@ impl InterfacePath { version, } } - + pub fn package_name(&self) -> Option<&str> { self.package_name.as_ref().map(|n| n.as_str()) }