Skip to content

Commit

Permalink
Migration: GitHub Actions
Browse files Browse the repository at this point in the history
- Add GitHub Actions for CI and CD (based off the functionality
  from the Engine)
- Add Issue Templates for bugs and features
- Add links to the communities
- Add a pull request template
  • Loading branch information
BenjamenMeyer committed Jan 13, 2021
1 parent d362307 commit 5c983c6
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior. Code examples are appreciated.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Please complete the following information):**
- OS: [e.g. iOS]
- Software Versions [e.g. 22]

**Additional context**
Add any other context about the problem here.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: Ask the Community on Gitter
url: https://gitter.im/vegastrike/community
about: Join the Vega Strike Gitter Discussion
- name: Vega Strike Forums
url: https://forums.vega-strike.org/
about: Join the Vega Strike Forums
- name: Vega Strike Official Wiki
url: https://wiki.vega-strike.org/
about: Read up at the Vega Strike Wiki
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Thank you for submitting a pull request and becoming a contributor to the Vega Strike: Upon the Coldest Sea.

Please answer the following:

Code Changes:
- [ ] Have the PR Validation Tests been run? See https://github.com/vegastrike/Vega-Strike-Engine-Source/wiki/Pull-Request-Validation
- [ ] This is a documentation change only

Issues:
- Please list any related issues

Purpose:
- What is this pull request trying to do?
- What release is this for?
- Is there a project or milestone we should apply this to?
67 changes: 67 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: CodeQL

on:
push:
# branches: ['master', '[0-9]?.[0-9]?.x']
pull_request:
# branches: ['master', '[0-9]?.[0-9]?.x']

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
# matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
# language: ['cpp', 'python']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# with:
# languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

- name: Bootstrap and Build the Code
run: script/cibuild

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
29 changes: 29 additions & 0 deletions .github/workflows/fortify-on-demand-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Fortify on Demand Scan

# Controls when the action will run.
on:
push:
# branches: ['master', '[0-9]?.[0-9]?.x']
pull_request:
# branches: ['master', '[0-9]?.[0-9]?.x']

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

jobs:
scan:
# 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
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Fortify on Demand Scan
# You may pin to the exact commit or the version.
# uses: fortify/gha-setup-fod-uploader@636f3c3a14aec1747eec5242a02c6349e4f3cce6
uses: fortify/[email protected]
with:
# FoDUploader version to use
version: latest
69 changes: 69 additions & 0 deletions .github/workflows/gh-actions-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: 'GH Actions - PR'

on: [ pull_request ]

jobs:
build:
name: Build
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
include:
# only do one Deb file because they're so large
#- FROM: 'ubuntu:focal'
# COMPILER: 'gcc'
# FLAGS: '-DUSE_PYTHON_3=ON'
#- FROM: 'ubuntu:focal'
# COMPILER: 'clang'
# FLAGS: '-DUSE_PYTHON_3=ON'
#- FROM: 'ubuntu:bionic'
# COMPILER: 'gcc'
# FLAGS: '-DUSE_PYTHON_3=ON'
#- FROM: 'ubuntu:bionic'
# COMPILER: 'clang'
# FLAGS: '-DUSE_PYTHON_3=ON'
#- FROM: 'ubuntu:xenial'
# COMPILER: 'gcc'
# FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'debian:buster'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'debian:stretch'
COMPILER: 'gcc'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'opensuse/leap'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'fedora:33'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'fedora:32'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'centos:8'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: false

# Ensure PRs are built against the PR Head
# As opposed to the merge commit
- name: Move to PR HEAD
run: git checkout HEAD^2
- name: Run CI
env:
FROM: ${{ matrix.FROM }}
COMPILER: ${{ matrix.COMPILER }}
FLAGS: ${{ matrix.FLAGS }}
MY_OS_NAME: linux
IS_RELEASE: 0
run: script/cibuild $FLAGS
79 changes: 79 additions & 0 deletions .github/workflows/gh-actions-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: 'GH Actions - Release'

on:
release:
types:
- created
- edited

jobs:
build:
name: Build
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
# only build one Deb File
#- FROM: 'ubuntu:focal'
# COMPILER: 'clang'
# FLAGS: '-DUSE_PYTHON_3=ON'
#- FROM: 'ubuntu:bionic'
# COMPILER: 'clang'
# FLAGS: '-DUSE_PYTHON_3=ON'
#- FROM: 'ubuntu:xenial'
# COMPILER: 'gcc'
# FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'debian:buster'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'debian:stretch'
COMPILER: 'gcc'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'opensuse/leap'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'fedora:33'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'fedora:32'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'
- FROM: 'centos:8'
COMPILER: 'clang'
FLAGS: '-DUSE_PYTHON_3=ON'

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
submodules: false

# where in a pull request we want to move to the head of the PR and not be at the
# merge commit; here we want to be at the HEAD of the ref

- name: Extract tag name etc
shell: bash
run: |
echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/} | sed 's/\//_/g')" >> $GITHUB_ENV
- name: Test tag name etc
run: |
echo "${TAG_NAME}"
- name: Run CI
env:
FROM: ${{ matrix.FROM }}
COMPILER: ${{ matrix.COMPILER }}
FLAGS: ${{ matrix.FLAGS }}
MY_OS_NAME: linux
IS_RELEASE: 1
run: script/cibuild $FLAGS
- name: Upload the artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'packages/*'

0 comments on commit 5c983c6

Please sign in to comment.