Merge pull request #42 from FirelightFlagboy/update-to-node20 #171
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: Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
# Install without login | |
install: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Snapcraft should not be installed | |
shell: bash | |
run: "! snapcraft --version" | |
- name: Run action | |
uses: ./ | |
- name: Snapcraft should be installed on macOS/Ubuntu | |
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') | |
run: snapcraft --version | |
- name: Snapcraft should track the `stable` channel on Linux | |
if: startsWith(matrix.os, 'ubuntu') | |
shell: bash | |
run: | | |
snap info snapcraft | |
grep -Eq 'tracking:\s+latest/stable' <(snap info snapcraft) | |
- name: Snapcraft should not be installed on Windows | |
if: startsWith(matrix.os, 'windows') | |
shell: bash | |
run: "! snapcraft --version" | |
# Install with login | |
login: | |
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: User should not be logged in | |
run: "! snapcraft whoami" | |
- name: Run action | |
uses: ./ | |
- name: User should be logged in | |
run: snapcraft whoami | |
# Install with channel | |
install-channel: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Run action | |
uses: ./ | |
with: | |
channel: candidate | |
- name: Snapcraft should track the `candidate` channel on Linux | |
shell: bash | |
run: | | |
snap info snapcraft | |
grep -Eq 'tracking:\s+latest/candidate' <(snap info snapcraft) | |
# Install with lxd | |
lxd: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, ubuntu-18.04] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- if: matrix.os == 'ubuntu-18.04' | |
name: lxd should not be available | |
run: "! /snap/bin/lxd waitready" | |
- name: Run action | |
uses: ./ | |
with: | |
use_lxd: ${{ matrix.os == 'ubuntu-18.04' }} | |
- name: lxd should be installed | |
run: "/snap/bin/lxd version" |