Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Hobson committed Nov 22, 2021
1 parent d837560 commit 7239c42
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,52 @@
name: tests

on:
pull_request:
branches: [master]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.17.1'

- name: Set up Python for pre-commit
uses: actions/setup-python@v2
with:
python-version: 3.9

- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
# make sure you update the pre-commit version below
key: ${{ env.pythonLocation }}-pip-pre-commit-2.14.0

- uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}

- name: Run pre-commit
run: |
# make sure you update the pip cache key above
pip install pre-commit==2.14.0
pre-commit run --all-files
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go mod tidy

- name: Run tests
run: go test ./...
9 changes: 9 additions & 0 deletions nix/default.nix
Expand Up @@ -27,6 +27,15 @@ in buildEnv {
rev = "9c3de9dd586506a7694fc9f19d459ad381239e34";
}) {}).pre-commit

(import (builtins.fetchGit {
# Descriptive name to make the store path easier to identify
name = "act-0.2.24";
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixpkgs-unstable";
rev = "a1de1fc28b27da87a84a0b4c9128972ac4a48193";
}) {}).act


];

}

0 comments on commit 7239c42

Please sign in to comment.