From 4b59dd862f6f7cea1846960e3c71558f8c0f7375 Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Tue, 26 Mar 2024 11:57:05 +0100 Subject: [PATCH] Add frontend CI --- .github/workflows/frontend.yml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/frontend.yml diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 000000000..560134b0b --- /dev/null +++ b/.github/workflows/frontend.yml @@ -0,0 +1,48 @@ +name: "Frontend checks" + +on: + merge_group: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + name: Build frontend + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + lints: + name: Check lints + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + - uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Build frontend + working-directory: ./kitsune-fe + run: nix develop ..#frontend --command bash -c "yarn && yarn lint"