From 26d533dd197f24a0c640126ba37e5c0b699d5ae2 Mon Sep 17 00:00:00 2001 From: Mike Landau Date: Tue, 25 Jul 2023 17:00:22 -0700 Subject: [PATCH] [tests] Add test for old nix versions (#1313) ## Summary Since we saw CLI format change (See https://github.com/jetpack-io/devbox/pull/1308) we should test against many nix versions. Possible followup: In `main` should we run all nix versions? ## How was it tested? CICD --- .github/workflows/cli-tests.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/cli-tests.yaml b/.github/workflows/cli-tests.yaml index 4b791cf4741..4143d781860 100644 --- a/.github/workflows/cli-tests.yaml +++ b/.github/workflows/cli-tests.yaml @@ -139,3 +139,31 @@ jobs: echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" > ~/.config/nix/nix.conf devbox run echo "Installing packages..." + - name: Test removing package + run: devbox rm go + + test-with-old-nix-version: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + version: [2.15.1] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version-file: ./go.mod + - name: Build devbox + run: go install ./cmd/devbox + - name: Install nix + run: sh <(curl -L https://releases.nixos.org/nix/nix-${{ matrix.version }}/install) --daemon + - name: Install devbox packages + run: | + # Setup github authentication to ensure Github's rate limits are not hit. + # If this works, we can consider refactoring this into a reusable github action helper. + mkdir -p ~/.config/nix + echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" > ~/.config/nix/nix.conf + + devbox run echo "Installing packages..." + - name: Test removing package + run: devbox rm go