Skip to content

Commit

Permalink
Use Nix in GitHub CI, codespell, rustfmt, clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinleroy committed Aug 25, 2024
1 parent ae63047 commit dd665de
Show file tree
Hide file tree
Showing 33 changed files with 701 additions and 288 deletions.
5 changes: 5 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = .git,target,node_modules,dist,*.yaml,*.lock,./book/book,*.min.js
ignore-words-list = implementor,implementors,ser,crate
count =
quiet-level = 3
28 changes: 28 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: publish-tutorial

on:
commit:
branches:
- "main"

jobs:
tutorial:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Nix
uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Build Tutorial
run: nix develop --command cd book && mdbook build

- uses: JamesIves/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: ./book/book
clean: true
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/workflows/setup

- name: Argus tests
uses: actions-rs/cargo@v1
- name: Install Nix
uses: cachix/install-nix-action@v17
with:
command: test
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Argus Test
run: nix develop --command ci-test
42 changes: 19 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
- name: Install Nix
uses: cachix/install-nix-action@v17
with:
crate: cargo-workspaces
version: latest
use-tool-cache: true
- name: Setup
uses: ./.github/workflows/setup
- run: cargo ws publish skip --no-remove-dev-deps --from-git --yes --token ${{ secrets.CRATES_IO }}
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- run: nix develop --command \
cargo ws publish skip --no-remove-dev-deps --from-git --yes --token ${{ secrets.CRATES_IO }}

publish-ide:
runs-on: ubuntu-latest
needs: publish-crates
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
- name: Install Nix
uses: cachix/install-nix-action@v17
with:
node-version: 20
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Setup
uses: ./.github/workflows/setup
- name: Build TS bindings
run: nix develop --command cargo make init-bindings

- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
id: publishToOpenVSX
with:
pat: ${{ secrets.OVSX_MRKT }}
packagePath: "./ide/packages/extension"
- name: Build VSIX
run: nix develop --command cd ide/packages/extension && vsce package

- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VSCODE_MRKT }}
registryUrl: https://marketplace.visualstudio.com
packagePath: "./ide/packages/extension"
- name: Publish VS Code Marketplace
run: nix develop --command cd ide/packages/extension && vsce publish -p ${{ secrets.VSCODE_MRKT }} --packagePath *.vsix

- name: Publish OVSX Marketplace
run: nix develop --command cd ide/packages/extension && pnpx ovsx publish *.vsix -p ${{ secrets.OVSX_MRKT }}
33 changes: 0 additions & 33 deletions .github/workflows/setup/action.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ gha-creds-*.json
/org/meeting*
/org/*.png
/org/media/
sample-book/

# Rust things
target/
Expand Down
1 change: 0 additions & 1 deletion book/.envrc

This file was deleted.

10 changes: 10 additions & 0 deletions book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ src = "src"
title = "Argus: a trait debugger for Rust"

[output.html]
default-theme = "light"

curly-quotes = true
additional-js = ["mermaid.min.js", "mermaid-init.js"]
additional-css = ["./mdbook-admonish.css"]

[preprocessor]

[preprocessor.image-size]
command = "mdbook-image-size"

[preprocessor.mermaid]
command = "mdbook-mermaid"

[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install`
61 changes: 0 additions & 61 deletions book/flake.lock

This file was deleted.

21 changes: 0 additions & 21 deletions book/flake.nix

This file was deleted.

Loading

0 comments on commit dd665de

Please sign in to comment.