Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fishinthecalculator committed Jan 7, 2024
1 parent 60a8a43 commit 1147ed7
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 136 deletions.
60 changes: 48 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,67 @@ name: CI
# Controls when the workflow will run
on:
pull_request:
paths-ignore:
- 'guix.scm'
- 'manifest.scm'
- 'channels-lock.scm'
- '.envrc'
- '.gitignore'
- 'pre-commit-*.yaml'
- Dockerfile
- README.*
- LICENSE
- 'sample_settings/**'
- 'etc/**'

push:
# Sequence of patterns matched against refs/tags
branches: ["master"]
paths-ignore:
- 'guix.scm'
- 'manifest.scm'
- 'channels-lock.scm'
- '.envrc'
- '.gitignore'
- 'pre-commit-*.yaml'
- Dockerfile
- README.*
- LICENSE
- 'sample_settings/**'
- 'etc/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
run-tests-dev:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
poetry-version: ["1.1.12", "1.7.0"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Set up Python 3.10
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
python-version: "3.10"
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: scripts/install_github_actions_dev_dependencies.sh
- name: Run tests in dev env
run: scripts/run_pipeline_tests.sh
run: scripts/run_pipeline_tests.sh
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
rev: stable
hooks:
- id: black
language_version: python3.9
language_version: python3.10
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
hooks:
Expand Down
2 changes: 1 addition & 1 deletion channels-lock.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit
"79a3cd34c0318928186a04b6481c4d22c0051d04")
"e7403acb345a59d580607fbfe7ef2aa0c410767a")
(introduction
(make-channel-introduction
"afb9f2752315f131e4ddd44eba02eed403365085"
Expand Down
29 changes: 13 additions & 16 deletions guix.scm
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
(define-module (guix)
#:use-module (guix git-download)
#:use-module (guix build-system python)
#:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages databases) ;; for python-tortoise-orm
#:use-module (gnu packages markup) ;; for python-markdownify
#:use-module (gnu packages python)
#:use-module (gnu packages python-web) ;; for python-uvicorn
#:use-module (gnu packages python-xyz) ;; for dynaconf
#:use-module (mobilizon-reshare package)
#:use-module (mobilizon-reshare dependencies)
#:use-module (ice-9 rdelim)
#:use-module (ice-9 popen))
(use-modules (guix git-download)
(guix build-system python)
(guix gexp)
(guix packages)
(guix utils)
(gnu packages markup) ;; for python-markdownify
(mobilizon-reshare package)
(ice-9 rdelim)
(ice-9 popen))

(define %source-dir (getcwd))

Expand All @@ -32,7 +26,10 @@
(package (inherit mobilizon-reshare)
(name "mobilizon-reshare.git")
(version (git-version source-version revision commit))
(source mobilizon-reshare-git-origin))))
(source mobilizon-reshare-git-origin)
(propagated-inputs
(modify-inputs (package-propagated-inputs mobilizon-reshare)
(replace "python-markdownify" python-markdownify))))))

(define-public mobilizon-reshare-scheduler
(package (inherit mobilizon-reshare.git)
Expand Down
2 changes: 1 addition & 1 deletion manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
(map cadr (package-direct-inputs mobilizon-reshare))
(map specification->package+output
'("git-cal" "man-db" "texinfo"
"python-pre-commit" "cloc"
"pre-commit" "cloc"
"ripgrep" "python-semver"
"fd" "docker-compose" "poetry"))))
Loading

0 comments on commit 1147ed7

Please sign in to comment.