From 0df6e96f384649c52e9b766cf8486cf38d1b8c81 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Fri, 10 Mar 2023 08:30:04 +1300 Subject: [PATCH] refactor: Format files using Prettier Actual command: `nix-shell --packages nodePackages.prettier --pure --run 'prettier --write .'`. --- .github/dependabot.yml | 19 ++++--- .github/workflows/test.yml | 106 ++++++++++++++++++------------------- README.md | 22 ++++---- action.yml | 24 ++++----- 4 files changed, 85 insertions(+), 86 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1a1a1c8..66647b5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,12 @@ version: 2 updates: - -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - time: '00:00' - timezone: UTC - open-pull-requests-limit: 10 - commit-message: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "00:00" + timezone: UTC + open-pull-requests-limit: 10 + commit-message: prefix: "chore" - include: "scope" \ No newline at end of file + include: "scope" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1b96e2..0bcd1b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,29 +12,29 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Install Nix - uses: ./ - with: - nix_path: nixpkgs=channel:nixos-22.11 - - run: nix-env -iA cachix -f https://cachix.org/api/v1/install - - run: cat /etc/nix/nix.conf - # cachix should be available and be able to configure a cache - - run: cachix use cachix - - run: nix-build test.nix + - uses: actions/checkout@v3 + - name: Install Nix + uses: ./ + with: + nix_path: nixpkgs=channel:nixos-22.11 + - run: nix-env -iA cachix -f https://cachix.org/api/v1/install + - run: cat /etc/nix/nix.conf + # cachix should be available and be able to configure a cache + - run: cachix use cachix + - run: nix-build test.nix custom-nix-path: strategy: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Install Nix - uses: ./ - with: - nix_path: nixpkgs=channel:nixos-20.03 - - run: test $NIX_PATH == "nixpkgs=channel:nixos-20.03" - - run: nix-build test.nix + - uses: actions/checkout@v3 + - name: Install Nix + uses: ./ + with: + nix_path: nixpkgs=channel:nixos-20.03 + - run: test $NIX_PATH == "nixpkgs=channel:nixos-20.03" + - run: nix-build test.nix extra-nix-config: strategy: @@ -42,15 +42,15 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Install Nix - uses: ./ - with: - nix_path: nixpkgs=channel:nixos-22.11 - extra_nix_config: | - sandbox = relaxed - - run: cat /etc/nix/nix.conf - - run: nix-build test.nix --arg noChroot true + - uses: actions/checkout@v3 + - name: Install Nix + uses: ./ + with: + nix_path: nixpkgs=channel:nixos-22.11 + extra_nix_config: | + sandbox = relaxed + - run: cat /etc/nix/nix.conf + - run: nix-build test.nix --arg noChroot true flakes: strategy: @@ -58,10 +58,10 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Install Nix - uses: ./ - - run: nix flake show github:NixOS/nixpkgs + - uses: actions/checkout@v3 + - name: Install Nix + uses: ./ + - run: nix flake show github:NixOS/nixpkgs installer-options: strategy: @@ -69,36 +69,36 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Install Nix - uses: ./ - with: - nix_path: nixpkgs=channel:nixos-22.11 - install_options: --tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve - install_url: https://nixos-nix-install-tests.cachix.org/serve/s62m7lc0q0mz2mxxm9q0kkrcg90njzhq/install - - run: nix-build test.nix + - uses: actions/checkout@v3 + - name: Install Nix + uses: ./ + with: + nix_path: nixpkgs=channel:nixos-22.11 + install_options: --tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve + install_url: https://nixos-nix-install-tests.cachix.org/serve/s62m7lc0q0mz2mxxm9q0kkrcg90njzhq/install + - run: nix-build test.nix oldest-supported-installer: strategy: - matrix: - os: [ubuntu-latest, macos-latest] + matrix: + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Install Nix - uses: ./ - with: - nix_path: nixpkgs=channel:nixos-22.11 - install_url: https://releases.nixos.org/nix/nix-2.8.0/install - - run: nix-build test.nix + - uses: actions/checkout@v3 + - name: Install Nix + uses: ./ + with: + nix_path: nixpkgs=channel:nixos-22.11 + install_url: https://releases.nixos.org/nix/nix-2.8.0/install + - run: nix-build test.nix act-support: strategy: - matrix: - os: [ubuntu-latest] + matrix: + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash - - run: docker pull ghcr.io/catthehacker/ubuntu:js-20.04 - - run: ./bin/act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-20.04 push -j simple-build + - uses: actions/checkout@v3 + - run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash + - run: docker pull ghcr.io/catthehacker/ubuntu:js-20.04 + - run: ./bin/act -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-20.04 push -j simple-build diff --git a/README.md b/README.md index 220087d..07ec76f 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ jobs: tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 - with: - nix_path: nixpkgs=channel:nixos-unstable - - run: nix-build + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v20 + with: + nix_path: nixpkgs=channel:nixos-unstable + - run: nix-build ``` ## Usage with Flakes @@ -51,12 +51,12 @@ jobs: tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 - with: - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - run: nix build - - run: nix flake check + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v20 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + - run: nix build + - run: nix flake check ``` To install Nix from any commit, go to [the corresponding installer_test action](https://github.com/NixOS/nix/runs/2219534360) and click on "Run cachix/install-nix-action@XX" step and expand the first line. diff --git a/action.yml b/action.yml index 9bd8e05..9c667a9 100644 --- a/action.yml +++ b/action.yml @@ -1,24 +1,24 @@ -name: 'Install Nix' -description: 'Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.' -author: 'Domen Kožar' +name: "Install Nix" +description: "Installs Nix on GitHub Actions for the supported platforms: Linux and macOS." +author: "Domen Kožar" inputs: extra_nix_config: - description: 'Gets appended to `/etc/nix/nix.conf` if passed.' + description: "Gets appended to `/etc/nix/nix.conf` if passed." github_access_token: - description: 'Configure nix to pull from github using the given github token.' + description: "Configure nix to pull from github using the given github token." install_url: - description: 'Installation URL that will contain a script to install Nix.' + description: "Installation URL that will contain a script to install Nix." install_options: - description: 'Additional installer flags passed to the installer script.' + description: "Additional installer flags passed to the installer script." nix_path: - description: 'Set NIX_PATH environment variable.' + description: "Set NIX_PATH environment variable." branding: - color: 'blue' - icon: 'sun' + color: "blue" + icon: "sun" runs: - using: 'composite' + using: "composite" steps: - - run : ${GITHUB_ACTION_PATH}/install-nix.sh + - run: ${GITHUB_ACTION_PATH}/install-nix.sh shell: bash env: INPUT_EXTRA_NIX_CONFIG: ${{ inputs.extra_nix_config }}