-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
174 additions
and
221 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: "Prepare nix-shell" | ||
description: | ||
Download cache, build nix-shell and potentially upload any new | ||
derivations to cache | ||
|
||
inputs: | ||
cachix_auth_token: | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: cachix/install-nix-action@v22 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: niteo-public | ||
authToken: '${{ inputs.cachix_auth_token }}' | ||
|
||
- name: Build nix-shell | ||
shell: bash | ||
run: nix-shell --run "echo 'nix-shell successfully entered'" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "Uncommitted Changes" | ||
description: | ||
Fail if any uncommitted changes are detected. | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: tj-actions/verify-changed-files@v14 | ||
id: verify-changed-files | ||
|
||
- name: List all changed files tracked and untracked files | ||
if: steps.verify-changed-files.outputs.files_changed == 'true' | ||
shell: bash | ||
run: | | ||
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}" | ||
exit 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Run all tests, linters, code analysis and other QA tasks on | ||
# every push to main and PRs. | ||
# | ||
# To SSH into the runner to debug a failure, add the following step before | ||
# the failing step | ||
# - uses: lhotari/action-upterm@v1 | ||
# with: | ||
# limit-access-to-actor: true | ||
|
||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
# Prevent multiple jobs running after fast subsequent pushes | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
tests: | ||
name: Tests | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/nix-shell | ||
with: | ||
cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN_PUBLIC }}' | ||
|
||
- run: nix-shell --run "make lint all=true" | ||
|
||
- run: nix-shell --run "make tests" | ||
|
||
- run: nix-shell --run "make dist" | ||
|
||
- uses: ./.github/actions/uncommitted-changes | ||
|
||
# yamllint disable | ||
# TODO: publishing workflow | ||
# steps: | ||
# - checkout | ||
|
||
# - configure_nix | ||
|
||
# - run: | ||
# name: Authenticate with registry | ||
# command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/salarycalc/.npmrc | ||
|
||
# - run: | ||
# name: Publish the package to NPM | ||
# command: nix-shell --run "npm version --no-git-tag-version prerelease --preid $(date +%Y-%m-%dT%H-%M-%S) && make dist && npm publish" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Build derivations for Linux and Apple Silicon and upload them to | ||
# Cachix | ||
|
||
name: Nix Cache | ||
|
||
on: | ||
push: | ||
paths: | ||
- "**.nix" | ||
- "**.lock" | ||
- "**package.json" | ||
- "**pyproject.toml" | ||
- ".github/**.ya?ml" | ||
workflow_dispatch: | ||
|
||
# Kill running jobs if a new commit is pushed to PR, or someone restarts | ||
# a job that is already running. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
prime: | ||
name: Prime Cachix | ||
|
||
strategy: | ||
# Keep building other OSes even if one fails | ||
fail-fast: false | ||
matrix: | ||
# ubuntu-latest-16-cores: Hosted GHA Linux runner, larger than default | ||
# so that this job primes the cache as much as possible before | ||
# other jobs that depend on the cache start running | ||
# macos-latest: Hosted GHA Intel-based MAC runner | ||
# macos-m1: TODO, GitHub says they will be available in Q4 | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/nix-shell | ||
with: | ||
cachix_auth_token: '${{ secrets.CACHIX_AUTH_TOKEN_PUBLIC }}' |
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
Oops, something went wrong.