Skip to content

Commit

Permalink
Deploy github pages with project docs (#74)
Browse files Browse the repository at this point in the history
* add from clippy --fix

* wasm deploy + docs

---------

Co-authored-by: João Pinheiro <joao.castropinheiro@gmail.com>
  • Loading branch information
joajfreitas and pineman committed Aug 10, 2024
1 parent 189a701 commit fb800a0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,41 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Version
run: rustc --version
- name: Run rustfmt
run: cargo fmt --check
- name: Unit tests
run: cargo test -- --include-ignored --nocapture
- name: Clippy
run: cargo clippy --all-features

deploy:
needs: CI
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Trunk
run: |
rustup target add wasm32-unknown-unknown
cargo install trunk
trunk build --public-url 'https://pineman.github.io/fpt' --release fpt-egui/index.html
- name: Docs
run: |
cargo doc --no-deps
cp -r target/doc/* fpt-egui/dist
- uses: actions/upload-pages-artifact@v3
with:
path: fpt-egui/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 3 additions & 2 deletions bin/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
cargo fmt

if CARGO_TERM_COLOR=always cargo clippy --all-features --fix --allow-dirty --allow-staged 2>&1 | tee >(grep -q "warning"); then
exit 0
git add $FILES
exit 0
else
exit 1
exit 1
fi
4 changes: 2 additions & 2 deletions fpt-egui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ impl FPT {
fn load_rom(&mut self, ui: &mut Ui) {
if let Ok(text) = self.rom_channel.1.try_recv() {
self.gb.load_rom(&text);
if let Some(BootromToFake::DMG0) = bootrom {
self..gb.boot_fake();
if let Some(BootromToFake::DMG0) = self.bootrom {
self.gb.boot_fake();
} else {
self.gb.boot_real();
}
Expand Down

0 comments on commit fb800a0

Please sign in to comment.