Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Github Actions #251

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
50 changes: 46 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,25 @@ on:
push:
branches:
- master
pull_request:
pull_request_target:

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Checkout pull request
uses: actions/checkout@v2
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
ref: 'refs/pull/${{ github.event.number }}/merge'
- name: Replace addons with pull request addons
if: ${{ github.event_name == 'pull_request_target' }}
run: |
rm -r addons
cp -r pullrequest/addons addons
- name: Validate SQF
run: python3 tools/sqf_validator.py
- name: Validate Config
Expand All @@ -32,6 +43,17 @@ jobs:
steps:
- name: Checkout the source code
uses: actions/checkout@master
- name: Checkout pull request
uses: actions/checkout@v2
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
ref: 'refs/pull/${{ github.event.number }}/merge'
- name: Replace addons with pull request addons
if: ${{ github.event_name == 'pull_request_target' }}
run: |
rm -r addons
cp -r pullrequest/addons addons
- name: Lint (sqflint)
uses: jokoho48/sqflint@master
continue-on-error: true # No failure due to many false-positives
Expand All @@ -47,8 +69,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: Checkout pull request
uses: actions/checkout@v2
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
ref: 'refs/pull/${{ github.event.number }}/merge'
- name: Replace addons with pull request addons
if: ${{ github.event_name == 'pull_request_target' }}
run: |
rm -r addons
cp -r pullrequest/addons addons
- name: Build addon with HEMTT
uses: arma-actions/hemtt@master
with:
Expand All @@ -69,6 +100,17 @@ jobs:
pip3 install pygithub3
- name: Checkout the source code
uses: actions/checkout@master
- name: Checkout pull request
uses: actions/checkout@v2
if: ${{ github.event_name == 'pull_request_target' }}
with:
path: pullrequest
ref: 'refs/pull/${{ github.event.number }}/merge'
- name: Replace addons with pull request addons
if: ${{ github.event_name == 'pull_request_target' }}
run: |
rm -r addons
cp -r pullrequest/addons addons
- name: Validate Stringtables
run: python3 tools/stringtable_validator.py
- name: Update Translation issue
Expand Down