ci: do not pin nixpkgs on generic flake test #571
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'nix-shell-action-test' | |
on: # rebuild any PRs and main branch changes | |
pull_request: | |
push: | |
branches: | |
- main | |
- support-devshell | |
- 'releases/*' | |
jobs: | |
build: # make sure build/ci work properly | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: | | |
npm install | |
- run: | | |
npm run all | |
test-latest-nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Test Basic Bash Shell | |
uses: ./ | |
with: | |
script: | | |
echo "test!" | |
- name: Test Bash Shell with Packages | |
uses: ./ | |
with: | |
packages: hello,docker | |
script: | | |
hello | |
command -v docker | |
- name: Test Bash Shell with Enviroment | |
uses: ./ | |
env: | |
FUTURE: now | |
ANSWER: 42 | |
with: | |
script: | | |
echo The future is $FUTURE | |
[[ -z "${ANSWER}" ]] && exit 1 || exit 0 | |
test-legacy-nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:release-21.05 | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Test Basic Bash Shell | |
uses: ./ | |
with: | |
script: | | |
echo "test!" | |
- name: Test Bash Shell with Packages | |
uses: ./ | |
with: | |
packages: hello,docker | |
script: | | |
hello | |
command -v docker | |
- name: Test Bash Shell with Enviroment | |
uses: ./ | |
env: | |
FUTURE: now | |
ANSWER: 42 | |
with: | |
script: | | |
echo The future is $FUTURE | |
[[ -z "${ANSWER}" ]] && exit 1 || exit 0 | |
test-pure: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: JAVA_HOME should not bleed into the environment in pure mode | |
uses: ./ | |
with: | |
packages: hello | |
pure: true | |
script: | | |
hello | |
[[ -z "${JAVA_HOME}" ]] && exit 0 || exit 1 | |
test-flakes: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Test Basic Bash Shell with Local Flake | |
uses: ./ | |
with: | |
flakes: .#hello | |
script: | | |
hello | |
- name: Test Bash Shell with Local and External Flakes | |
uses: ./ | |
with: | |
flakes: .#hello,nixpkgs#docker | |
script: | | |
hello | |
command -v docker | |
test-pure-flakes: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: JAVA_HOME should not bleed into the environment in pure mode | |
uses: ./ | |
with: | |
flakes: .#hello | |
pure: true | |
script: | | |
hello | |
[[ -z "${JAVA_HOME}" ]] && exit 0 || exit 1 | |
test-local-flake-in-working-directory: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Test Bash Shell with Local and External Flakes | |
uses: ./ | |
with: | |
flakes: .#cowsay,nixpkgs#docker | |
working-directory: test/working-directory | |
script: | | |
pwd | |
cowsay hello | |
command -v docker | |
test-flakes-from-devshell: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Test Bash Shell with Local and External Flakes | |
uses: ./ | |
with: | |
flakes-from-devshell: true | |
script: | | |
pwd | |
figlet "I'm from the devshell, baby." | |
test-flakes-from-devshell-in-working-directory: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Test Bash Shell with Local Flake in a Working Directory | |
uses: ./ | |
with: | |
working-directory: test/devshell-flake | |
flakes-from-devshell: true | |
script: | | |
pwd | |
cmatrix -h |