Skip to content

Commit

Permalink
refactor(ci): switch from docker to local gha runner tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Nov 8, 2023
1 parent 09b4b41 commit 70fe241
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,37 @@ name: tests

on: pull_request

env:
TEST_TAG: monopoly-test:latest

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Git Crypt
- uses: actions/cache@v3
id: brew-cache
with:
path: /home/linuxbrew/.linuxbrew
key: brew-packages-${{ runner.os }}-${{ hashFiles('.github/workflows/main.yml') }}
restore-keys: |
brew-packages-${{ runner.os }}-
- name: Install pdftotext dependencies
run: |
sudo apt-get update && sudo apt-get -y install build-essential libpoppler-cpp-dev pkg-config
- name: Setup Python & Poetry
uses: ./.github/actions/setup-python-poetry
with:
python-version: "3.11"
poetry-version: "1.6.1"

- name: Install git crypt/john & run tests
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install git-crypt
brew fetch git-crypt & brew fetch john-jumbo
brew install git-crypt john-jumbo
echo '${{ secrets.GIT_CRYPT_KEY }}' | base64 --decode > /tmp/git-crypt-key
git-crypt unlock /tmp/git-crypt-key
rm /tmp/git-crypt-key
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image
uses: docker/build-push-action@v4
with:
context: .
load: true
target: test
tags: ${{ env.TEST_TAG }}
cache-from: type=gha,scope=test
cache-to: type=gha,mode=max,scope=test

- name: Test
run: docker run --rm ${{ env.TEST_TAG }}
poetry run task test

0 comments on commit 70fe241

Please sign in to comment.