lix-installer/.github/workflows/ci.yml

155 lines
5.3 KiB
YAML
Raw Normal View History

2022-09-09 19:02:43 +00:00
name: CI
on:
pull_request:
push:
branches: [main]
jobs:
Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Check rustfmt
run: nix develop --command ci-check-rustfmt
Spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Check Spelling
run: nix develop --command ci-check-spelling
NixFormatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Check nixpkgs-fmt formatting
run: nix develop --command ci-check-nixpkgs-fmt
EditorConfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Check EditorConfig conformance
run: nix develop --command ci-check-editorconfig
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: nix develop --command ci-test-rust
# run: nix develop -c -- cargo test -- --include-ignored
BuildX86Linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
# Runs clippy as part of the preBuild.
- name: Build harmonic
run: nix build .#packages.x86_64-linux.harmonic -L
- name: Build harmonicStatic
run: nix build .#packages.x86_64-linux.harmonicStatic -L
- name: Create artifact for x86_64-linux harmonicStatic
uses: actions/upload-artifact@v3
with:
name: harmonic-x86_64-linux
path: |
result/bin/harmonic
RunX86Linux:
runs-on: ubuntu-latest
needs: BuildX86Linux
steps:
- uses: actions/download-artifact@v3
with:
name: harmonic-x86_64-linux
- name: Set executable
run: chmod +x ./harmonic
- name: Initial install
2022-11-10 18:23:00 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic install linux-multi --extra-conf "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" --no-confirm
- name: Test run
2022-11-08 21:04:19 +00:00
run: |
2022-11-08 21:21:32 +00:00
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
2022-11-08 21:04:19 +00:00
nix run nixpkgs#fortune
- name: Initial uninstall
2022-11-08 21:04:19 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic uninstall --no-confirm
- name: Repeated install
2022-11-10 18:23:00 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic install linux-multi --extra-conf "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" --no-confirm
2022-11-09 17:25:29 +00:00
- name: Repeated test run
run: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
nix run nixpkgs#fortune
- name: Repeated uninstall
2022-11-08 21:04:19 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic uninstall --no-confirm
2022-09-09 19:02:43 +00:00
BuildX86Darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
# Runs clippy as part of the preBuild.
- name: Build harmonic
run: nix build .#packages.x86_64-darwin.harmonic -L
- name: Create artifact for x86_64-darwin harmonic
uses: actions/upload-artifact@v3
with:
name: harmonic-x86_64-darwin
path: |
result/bin/harmonic
RunX86Darwin:
runs-on: macos-latest
needs: BuildX86Darwin
steps:
- uses: actions/download-artifact@v3
with:
name: harmonic-x86_64-darwin
2022-11-09 17:33:19 +00:00
- name: Set executable
run: chmod +x ./harmonic
- name: Initial install
2022-11-10 18:23:00 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic install darwin-multi --extra-conf "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" --no-confirm
- name: Test run
2022-11-08 21:04:19 +00:00
run: |
2022-11-08 21:21:32 +00:00
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
2022-11-08 21:04:19 +00:00
nix run nixpkgs#fortune
- name: Initial uninstall
2022-11-08 21:04:19 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic uninstall --no-confirm
- name: Repeated install
2022-11-10 18:23:00 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic install darwin-multi --extra-conf "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" --no-confirm
2022-11-09 17:25:29 +00:00
- name: Repeated test run
run: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
nix run nixpkgs#fortune
- name: Repeated uninstall
2022-11-08 21:04:19 +00:00
run: sudo RUST_LOG=harmonic=trace RUST_BACKTRACE=full ./harmonic uninstall --no-confirm