diff --git a/.github/actions/yarn/action.yml b/.github/actions/yarn/action.yml index cd88040e6..ee50ad6da 100644 --- a/.github/actions/yarn/action.yml +++ b/.github/actions/yarn/action.yml @@ -1,22 +1,34 @@ name: Yarn description: Sets up the Yarn, the Yarn Cache, and installs +inputs: + cachix-auth-token: + required: true + description: "Your Cachix auth token." + runs: using: composite steps: - - uses: actions/setup-node@v2 + # Install Cachix + - uses: cachix/install-nix-action@v17 + - name: Setup Cachix + uses: cachix/cachix-action@v10 with: - node-version: "14" + name: saber + authToken: ${{ inputs.cachix-auth-token }} + + # Install Node + - uses: actions/setup-node@v3 - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - shell: bash + shell: nix shell .#ci --command bash {0} - name: Yarn Cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-modules- - run: yarn install - shell: bash + shell: nix shell .#ci --command bash {0} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe73c6379..7e0958027 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,12 +6,18 @@ on: pull_request: branches: [master] +defaults: + run: + shell: nix shell .#ci --command bash {0} + jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ./.github/actions/yarn + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: yarn build - run: yarn size @@ -20,6 +26,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/yarn + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: yarn build - run: yarn typecheck @@ -28,6 +36,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/yarn + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: yarn build - run: yarn test @@ -36,6 +46,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/yarn + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: yarn build - run: yarn lint:ci @@ -44,6 +56,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/yarn + with: + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} # workaround b/c it's broken - run: yarn plugin remove @yarnpkg/plugin-version - run: yarn doctor packages/ diff --git a/flake.nix b/flake.nix index 9e74b83b1..3f932ad89 100644 --- a/flake.nix +++ b/flake.nix @@ -14,7 +14,7 @@ rec { packages.ci = pkgs.buildEnv { name = "ci"; - paths = with pkgs; [ nodejs yarn nixpkgs-fmt ]; + paths = with pkgs; [ nodejs yarn nixpkgs-fmt bash ]; }; devShell = pkgs.mkShell { buildInputs = [ packages.ci ]; }; }); diff --git a/package.json b/package.json index 1735d9297..8db39ba92 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ ], "lint-staged": { "*.nix": "nixpkgs-fmt", - "*.{ts,tsx}": "eslint --cache --fix", - "*.{md,js,json,yml,yaml,css,md}": "prettier --write" + "*.{ts,tsx,mts,cts}": "eslint --cache --fix", + "*.{md,js,jsx,json,yml,yaml,css,md}": "prettier --write" }, "devDependencies": { "@babel/core": "^7.18.2", diff --git a/yarn.lock b/yarn.lock index 1989f9d2d..ceea20011 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3238,7 +3238,7 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^18.0.10": +"@types/react@npm:^18.0.10, @types/react@npm:^18.0.9": version: 18.0.10 resolution: "@types/react@npm:18.0.10" dependencies: