From f104ed217eeedd0e9ab27ec8f4adc3fba2da03fc Mon Sep 17 00:00:00 2001 From: awwpotato <153149335+awwpotato@users.noreply.github.com> Date: Tue, 10 Dec 2024 12:19:05 -0800 Subject: [PATCH] Fix build action (#23) * change yaml tab space * fix build action * add prettier to nix dev shell * add check for nix dev shell * also check nix on pr * fix use path thingy :3 * add inputs to flake.nix --- .editorconfig | 2 +- .github/workflows/build.yml | 26 ++++++++++---------------- .github/workflows/format.yml | 34 +++++++++++++++++----------------- .github/workflows/nix.yml | 22 ++++++++++++++++++++++ flake.nix | 6 ++++++ 5 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/nix.yml diff --git a/.editorconfig b/.editorconfig index bbf92a5..8adb3e6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,5 +6,5 @@ insert_final_newline = true indent_style = space indent_size = 4 -[*.nix] +[*.{yml,yaml,nix}] indent_size = 2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c745662..2a0b2f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,21 +1,15 @@ name: Build on: - pull_request: + pull_request: jobs: - format: - runs-on: ubuntu-latest - name: Build Application - steps: - - name: Checkout - - uses: actions/checkout@v3 - - - name: Setup - - uses: oven-sh/setup-bun@v2 - - - name: Install - - run: bun install - - - name: Build - - run: bun run build + format: + runs-on: ubuntu-latest + name: Build Application + steps: + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v2 + - run: bun install + - name: Build + run: bun run build diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 79e544f..130c1b1 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,22 +1,22 @@ name: Format on: - push: - pull_request: + push: + pull_request: jobs: - format: - runs-on: ubuntu-latest - name: Format Files - steps: - - uses: actions/checkout@v3 - - uses: oven-sh/setup-bun@v2 - - run: bun install - - name: Prettier - run: bun run format ./src - env: - GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} - - uses: stefanzweifel/git-auto-commit-action@v4 - if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} - with: - commit_message: 'style: format files' + format: + runs-on: ubuntu-latest + name: Format Files + steps: + - uses: actions/checkout@v3 + - uses: oven-sh/setup-bun@v2 + - run: bun install + - name: Prettier + run: bun run format ./src + env: + GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} + - uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + with: + commit_message: 'style: format files' diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..f0c33cb --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,22 @@ +on: + pull_request: + paths: + - 'flake.nix' + push: + paths: + - 'flake.nix' + +jobs: + nix-check: + name: Check Nix Dev Shell + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v12 + - name: Magic Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@v7 + - name: Check + run: nix flake check -L diff --git a/flake.nix b/flake.nix index c26c8a9..29857ea 100644 --- a/flake.nix +++ b/flake.nix @@ -1,4 +1,9 @@ { + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, @@ -14,6 +19,7 @@ devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ bun + nodePackages.prettier ]; }; });