Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 3, 2024
1 parent 8242b5e commit 0c2b518
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/linux-nix-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and Test on Linux Platforms

on:
workflow_call:

jobs:
build-and-test:
name: "Build and test Linux"
runs-on: [self-hosted, Linux, X64, aws_autoscaling]
steps:
# https://github.com/actions/checkout/issues/1552
- name: Clean up after previous checkout
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*;

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run checks
run: nix flake -L check
env:
NIX_CONFIG: |
cores = 6
26 changes: 26 additions & 0 deletions .github/workflows/mac-nix-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Crypto3 Build and Test on macOS Platforms

on:
workflow_call:

jobs:
build-and-test:
name: "Build and test macOS"
runs-on: [macos-14]
steps:
- name: Checkout Crypto3
uses: actions/checkout@v4
with:
fetch-depth: 0

# From https://github.com/DeterminateSystems/magic-nix-cache-action
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main

- name: Run checks
run: nix flake -L check
env:
NIX_CONFIG: |
cores = 0
max-jobs = 1
30 changes: 30 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PR Testing

on:
pull_request:
push:
branches:
- master

concurrency:
# In master we want to run for every commit, in other branches — only for the last one
group: ${{
( github.ref == 'refs/heads/master' && format('{0}/{1}/{2}', github.workflow, github.ref, github.sha) )
||
format('{0}/{1}', github.workflow, github.ref) }}
cancel-in-progress: true

jobs:
test-linux:
name: Linux Crypto3 Testing
uses: ./.github/workflows/linux-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit

test-mac:
name: macOS Crypto3 Testing
uses: ./.github/workflows/mac-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit

0 comments on commit 0c2b518

Please sign in to comment.