Skip to content

Self hosted runner #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 12 additions & 32 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: [ self-hosted, "${{ matrix.os }}" ]

strategy:
fail-fast: false
matrix:
ghc: ["9.0.1", "8.10.7", "8.8.4", "8.6.5"]
os: [ubuntu-latest]
ghc: ["9.6.6"]
os: [macOS]

steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
Expand All @@ -36,21 +36,18 @@ jobs:
- name: Configure project
run: cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=ghc8.4.4+

- name: Restore cabal cache
uses: haskell-works/cabal-cache-action@v1
- name: Cabal cache over S3
uses: action-works/cabal-cache-s3@v1
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }}
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }}
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }}
with:
args: |
sync-from-archive \
--threads "$BINARY_CACHE_THREADS" \
--archive-uri "$BINARY_CACHE_URI" \
--region "$BINARY_CACHE_REGION" \
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}"
region: us-west-2
dist-dir: dist-newstyle
store-path: ${{ steps.setup-haskell.outputs.cabal-store }}
threads: 16
archive-uri: ${{ secrets.BINARY_CACHE_URI }}/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}/${{ matrix.cabal }}/${{ matrix.ghc }}
skip: "${{ secrets.BINARY_CACHE_URI == '' }}"

- name: Build
# Try building it twice in case of flakey builds on Windows
Expand All @@ -62,23 +59,6 @@ jobs:
run: |
cabal test all --enable-tests --enable-benchmarks --write-ghc-environment-files=ghc8.4.4+

- name: Save cabal cache
uses: haskell-works/cabal-cache-action@v1
if: ${{ always() }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }}
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }}
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }}
with:
args: |
sync-to-archive \
--threads "$BINARY_CACHE_THREADS" \
--archive-uri "$BINARY_CACHE_URI" \
--region "$BINARY_CACHE_REGION" \
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}"

check:
needs: build
runs-on: ubuntu-latest
Expand Down
Loading