Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: Merge in development
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Dec 14, 2020
2 parents e62d6c8 + 2b5c2d1 commit f06d6f2
Show file tree
Hide file tree
Showing 9 changed files with 324 additions and 337 deletions.
110 changes: 0 additions & 110 deletions .github/workflows/ci.yml

This file was deleted.

198 changes: 198 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
name: CI/CD
on:
push:
branches:
- development
- master
pull_request:
jobs:
test:
name: Run JS/Python/Cypress tests
if: github.event.head_commit.author.email != 'action@github.com'
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7.x
architecture: x64
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: |
pip install pipenv
pipenv install --dev --system
cd game_frontend
yarn --frozen-lockfile
- name: Run Javascript tests
run: |
cd game_frontend
yarn lint
yarn test --coverage
- name: Bundle Frontend
env:
NODE_ENV: production
run: |
cd game_frontend
node djangoBundler.js
- name: Run Python tests
run: python all_tests.py -c --no-docker-container-tests
- name: Run Cypress tests
uses: cypress-io/github-action@v2
with:
install: false
start: python ../run.py -c
working-directory: game_frontend
wait-on: http://localhost:8000
wait-on-timeout: 400
record: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

test-aimmo-game:
name: Test aimmo-game
if: github.event.head_commit.author.email != 'action@github.com'
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build docker image
run: |
cd aimmo-game
docker build -t ocadotechnology/aimmo-game:test --target tester .
- name: Run tests
run: docker run -i -p 5000:5000 ocadotechnology/aimmo-game:test /bin/bash -c "coverage run setup.py test && coverage xml"
- name: Get the coverage data from the container
run: |
read CONTAINERID <<< $(docker ps --all -q | head -1)
docker cp -a $CONTAINERID:.coverage $(pwd)/.coverage
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

test-aimmo-game-creator:
name: Test aimmo-game-creator
if: github.event.head_commit.author.email != 'action@github.com'
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build docker image
run: |
cd aimmo-game-creator
docker build -t ocadotechnology/aimmo-game-creator:test --target tester .
- name: Run tests
run: docker run -i -p 5000:5000 ocadotechnology/aimmo-game-creator:test /bin/bash -c "coverage run setup.py test && coverage xml"
- name: Get the coverage data from the container
run: |
read CONTAINERID <<< $(docker ps --all -q | head -1)
docker cp -a $CONTAINERID:.coverage $(pwd)/.coverage
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

test-aimmo-game-worker:
name: Test aimmo-game-worker
if: github.event.head_commit.author.email != 'action@github.com'
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build docker image
run: |
cd aimmo-game-worker
docker build -t ocadotechnology/aimmo-game-worker:test --target tester .
- name: Run tests
run: docker run -i -p 5000:5000 ocadotechnology/aimmo-game-worker:test /bin/bash -c "coverage run setup.py test && coverage xml"
- name: Get the coverage data from the container
run: |
read CONTAINERID <<< $(docker ps --all -q | head -1)
docker cp -a $CONTAINERID:.coverage $(pwd)/.coverage
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

publish-python:
name: Publish aimmo PyPi package
needs:
[test, test-aimmo-game, test-aimmo-game-creator, test-aimmo-game-worker]
if: github.event_name == 'push' && github.event.head_commit.author.email != 'action@github.com'
runs-on: ubuntu-18.04
env:
NODE_ENV: production
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7.x
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install frontend dependencies
run: |
cd game_frontend
yarn --frozen-lockfile
- name: Install wheel
run: pip install wheel
- name: Build worker wheel
run: ./aimmo_runner/build_worker_wheel.sh
- name: Bundle Frontend
run: |
cd game_frontend
node djangoBundler.js
- name: Set branch
id: branch
run: |
echo "::set-output name=branch::${GITHUB_REF##*/}" # get the substring from GITHUB_REF after the last '/'
- name: Release aimmo
uses: ocadotechnology/python-semantic-release@updated-beta-releases
with:
github_token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}
branch: ${{ steps.branch.outputs.branch }}
build: ${{ github.run_number }}

merge-master-into-development:
name: Merge master into development after release
needs: [publish-python]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-18.04
steps:
- name: Checkout development branch
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: development
persist-credentials: false
- name: Setup git username
run: |
git config --global user.name "github-actions"
git config --global user.email "action@github.com"
- name: Merge master into development
run: |
git merge origin/master
git remote add authed-origin https://${GH_TOKEN}@github.com/ocadotechnology/aimmo.git > /dev/null 2>&1
git push --quiet --set-upstream authed-origin development
env:
GH_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
38 changes: 0 additions & 38 deletions .github/workflows/cypress.yml

This file was deleted.

Loading

0 comments on commit f06d6f2

Please sign in to comment.