Skip to content

Commit

Permalink
Moved ingest actions to ci.yaml and pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Teddy-1000 committed Jan 12, 2024
1 parent 37a30ed commit 980b569
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 76 deletions.
63 changes: 44 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI
on:
push:
branches:
- '**'
- "**"
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- "[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: read
Expand All @@ -14,31 +14,31 @@ jobs:
pre-commit-hook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install pre-commit
run: python -m pip install pre-commit
shell: bash
- name: Show pre-commit requirements
run: python -m pip freeze --local
shell: bash
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit for all files
run: pre-commit run --config './.pre-commit-config.yaml' --all-files --color=always --show-diff-on-failure
shell: bash
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install pre-commit
run: python -m pip install pre-commit
shell: bash
- name: Show pre-commit requirements
run: python -m pip freeze --local
shell: bash
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit for all files
run: pre-commit run --config './.pre-commit-config.yaml' --all-files --color=always --show-diff-on-failure
shell: bash

test:
test-datastore:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: "3.11"

- name: Copy Protobuf files to Dockerfile directories
run: ./ci/docker/copy-protobuf.sh
Expand Down Expand Up @@ -85,3 +85,28 @@ jobs:
- name: Cleanup
if: always()
run: docker compose down --volumes
test-ingest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"] # Add 3.11 back pybind11 bug is fixed
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Ubuntu setup
run: sudo apt update && sudo apt install libeccodes-data rapidjson-dev pybind11-dev libssl-dev
- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Checkout Source
uses: actions/checkout@v3
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install pytest-timeout
pip install pytest-cov
pip install ./ingest
- name: Run Tests
run: python -m pytest -v --timeout=60 ./ingest
20 changes: 0 additions & 20 deletions .github/workflows/cpp-syntax.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/syntax.yml

This file was deleted.

26 changes: 14 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ repos:
entry: ./ci/go/go-fmt.sh
language: script
pass_filenames: false
# # go-vet ~ Finds subtle issues in Go where your code may not work as intended
# - id: go-vet
# name: go-vet
# description: "Finds subtle issues in Go where your code may not work as intended."
# entry: ./ci/go/go-vet.sh
# language: script
# pass_filenames: false
# # go-vet ~ Finds subtle issues in Go where your code may not work as intended
# - id: go-vet
# name: go-vet
# description: "Finds subtle issues in Go where your code may not work as intended."
# entry: ./ci/go/go-vet.sh
# language: script
# pass_filenames: false

- repo: https://github.com/pocc/pre-commit-hooks
rev: master
hooks:
- id: clang-format
args: [--style=llvm]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand Down Expand Up @@ -53,11 +59,7 @@ repos:
rev: 7.0.0
hooks:
- id: flake8
args:
[
"--ignore=W503",
"--max-line-length=120",
]
args: ["--ignore=W503", "--max-line-length=120"]

# hadolint ~ Docker linter
- repo: https://github.com/hadolint/hadolint
Expand Down

0 comments on commit 980b569

Please sign in to comment.