Skip to content

Commit

Permalink
build: add continuous integration github action
Browse files Browse the repository at this point in the history
With lint and test
  • Loading branch information
igobranco committed Oct 17, 2023
1 parent 8e8b2a9 commit 58b2950
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: CI

on:
pull_request:
push:
branches:
- master
- main

jobs:
prepare:
name: Run tests and linting
runs-on: ubuntu-latest

steps:
- name: Checkout PayGate
uses: actions/checkout@v4
with:
# Relative path to place the repository
path: ecommerce-plugin-paygate

- name: Checkout ecommerce
uses: actions/checkout@v4
with:
# Repository name with owner
repository: fccn/ecommerce
# Change the branch to checkout
ref: nau/nutmeg.master
# Relative path to place the repository
path: ecommerce

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip' # caching pip dependencies

- name: Install ecommerce pip requirements
run: pip install -r ecommerce/requirements/dev.txt

lint:
name: Lint code
runs-on: ubuntu-latest
needs:
- prepare

steps:
- name: Checkout PayGate
uses: actions/checkout@v4
with:
# Relative path to place the repository
path: ecommerce-plugin-paygate

- name: Checkout ecommerce
uses: actions/checkout@v4
with:
# Repository name with owner
repository: fccn/ecommerce
# Change the branch to checkout
ref: nau/nutmeg.master
# Relative path to place the repository
path: ecommerce

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip' # caching pip dependencies

- name: Install ecommerce pip requirements
run: pip install -r ecommerce/requirements/dev.txt

- name: Run lint
run: make -C ecommerce-plugin-paygate lint

test:
name: Unit tests
runs-on: ubuntu-latest
needs:
- prepare

steps:
- name: Checkout PayGate
uses: actions/checkout@v4
with:
# Relative path to place the repository
path: ecommerce-plugin-paygate

- name: Checkout ecommerce
uses: actions/checkout@v4
with:
# Repository name with owner
repository: fccn/ecommerce
# Change the branch to checkout
ref: nau/nutmeg.master
# Relative path to place the repository
path: ecommerce

- name: Use Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip' # caching pip dependencies

- name: Install ecommerce pip requirements
run: pip install -r ecommerce/requirements/dev.txt

- name: Run unit tests
run: make -C ecommerce-plugin-paygate test

0 comments on commit 58b2950

Please sign in to comment.