|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: Turdis |
| 4 | + |
| 5 | +# Controls when the action will run. Triggers the workflow on push or pull request |
| 6 | +# events but only for the master branch |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + branches: master |
| 10 | + push: |
| 11 | + branches: master |
| 12 | + |
| 13 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 14 | +jobs: |
| 15 | + lint: |
| 16 | + name: Lints |
| 17 | + runs-on: ubuntu-18.04 |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + |
| 21 | + - name: Cache SpacemanDMM |
| 22 | + uses: actions/cache@v1 |
| 23 | + with: |
| 24 | + path: ~/SpacemanDMM |
| 25 | + key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}} |
| 26 | + restore-keys: ${{ runner.os }}-dreamchecker |
| 27 | + |
| 28 | + - name: Setup Python |
| 29 | + uses: actions/setup-python@v1.2.0 |
| 30 | + |
| 31 | + - name: Setup Rust |
| 32 | + uses: hecrj/setup-rust-action@v1.3.2 |
| 33 | + with: |
| 34 | + default: true |
| 35 | + |
| 36 | + - name: Setup PHP |
| 37 | + uses: nanasess/setup-php@v3.0.3 |
| 38 | + with: |
| 39 | + php_version: 5.6 |
| 40 | + |
| 41 | + - name: Install Dependencies |
| 42 | + run: | |
| 43 | + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash |
| 44 | + tools/travis/install_build_tools.sh |
| 45 | + tools/travis/install_spaceman_dmm.sh dreamchecker |
| 46 | +
|
| 47 | + - name: Misc Checks |
| 48 | + run: | |
| 49 | + tools/travis/check_filedirs.sh yogstation.dme |
| 50 | + tools/travis/check_changelogs.sh |
| 51 | + find . -name "*.php" -print0 | xargs -0 -n1 php -l |
| 52 | + find . -name "*.json" -not -path "./tgui/node_modules/*" -print0 | xargs -0 python3 ./tools/json_verifier.py |
| 53 | + tools/travis/build_tgui.sh |
| 54 | + tools/travis/check_grep.sh |
| 55 | +
|
| 56 | + - name: Run Linter |
| 57 | + run: ~/dreamchecker |
| 58 | + compile: |
| 59 | + name: Compile All Maps |
| 60 | + runs-on: ubuntu-18.04 |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + |
| 64 | + - name: Install Dependencies |
| 65 | + run: | |
| 66 | + curl https://raw.githubusercontent.com/yogstation13/Yogstation/master/.github/sources.list | sudo tee /etc/apt/sources.list |
| 67 | + sudo dpkg --add-architecture i386 |
| 68 | + sudo apt-get update |
| 69 | + sudo apt install libstdc++6:i386 |
| 70 | + |
| 71 | + - name: Cache BYOND |
| 72 | + uses: actions/cache@v1 |
| 73 | + with: |
| 74 | + path: ~/BYOND |
| 75 | + key: ${{ runner.os }}-byond-${{ hashFiles('Dockerfile')}} |
| 76 | + restore-keys: ${{ runner.os }}-byond |
| 77 | + |
| 78 | + - name: Setup BYOND |
| 79 | + run: | |
| 80 | + tools/travis/install_byond.sh |
| 81 | + cd $GITHUB_WORKSPACE |
| 82 | + printenv |
| 83 | + echo "::set-env name=BYOND_SYSTEM::/home/runner/BYOND/byond" |
| 84 | + echo "::set-env name=PATH::/home/runner/BYOND/byond/bin:$PATH" |
| 85 | + echo "::set-env name=LD_LIBRARY_PATH::/home/runner/BYOND/byond/bin:$LD_LIBRARY_PATH" |
| 86 | + echo "::set-env name=MANPATH::/home/runner/BYOND/byond/man:$MANPATH" |
| 87 | + |
| 88 | + - name: Compile All Maps |
| 89 | + run: | |
| 90 | + tools/travis/template_dm_generator.py |
| 91 | + tools/travis/dm.sh -DTRAVISBUILDING -DTRAVISTESTING -DALL_MAPS yogstation.dme |
| 92 | + test: |
| 93 | + name: Compile and Run Tests |
| 94 | + runs-on: ubuntu-18.04 |
| 95 | + services: |
| 96 | + mariadb: |
| 97 | + image: mariadb/server |
| 98 | + ports: |
| 99 | + - 3306:3306 |
| 100 | + env: |
| 101 | + MARIADB_ALLOW_EMPTY_PASSWORD: yes |
| 102 | + |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@v2 |
| 105 | + |
| 106 | + - name: Install Dependencies |
| 107 | + run: | |
| 108 | + curl https://raw.githubusercontent.com/yogstation13/Yogstation/master/.github/sources.list | sudo tee /etc/apt/sources.list |
| 109 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa |
| 110 | + sudo dpkg --add-architecture i386 |
| 111 | + sudo apt-get update |
| 112 | + sudo apt install libstdc++6:i386 gcc-multilib g++-7 g++-7-multilib libmariadb-client-lgpl-dev:i386 libmariadbd-dev |
| 113 | + |
| 114 | + - name: Cache BYOND |
| 115 | + uses: actions/cache@v1 |
| 116 | + with: |
| 117 | + path: ~/BYOND |
| 118 | + key: ${{ runner.os }}-byond-${{ hashFiles('Dockerfile')}} |
| 119 | + restore-keys: ${{ runner.os }}-byond |
| 120 | + |
| 121 | + - name: Setup Environment |
| 122 | + run: | |
| 123 | + tools/travis/install_byond.sh |
| 124 | + echo "::set-env name=BYOND_SYSTEM::/home/runner/BYOND/byond" |
| 125 | + echo "::set-env name=PATH::/home/runner/BYOND/byond/bin:$PATH" |
| 126 | + echo "::set-env name=LD_LIBRARY_PATH::/home/runner/BYOND/byond/bin:$LD_LIBRARY_PATH" |
| 127 | + echo "::set-env name=MANPATH::/home/runner/BYOND/byond/man:$MANPATH" |
| 128 | + cd $GITHUB_WORKSPACE |
| 129 | + tools/travis/install_libmariadb.sh |
| 130 | + tools/travis/install_rust_g.sh |
| 131 | + mysql -u root -h 127.0.0.1 -e 'CREATE DATABASE tg_travis;' |
| 132 | + mysql -u root -h 127.0.0.1 tg_travis < SQL/tgstation_schema.sql |
| 133 | + mysql -u root -h 127.0.0.1 -e 'CREATE DATABASE tg_travis_prefixed;' |
| 134 | + mysql -u root -h 127.0.0.1 tg_travis_prefixed < SQL/tgstation_schema_prefixed.sql |
| 135 | + tools/travis/build_bsql.sh |
| 136 | + |
| 137 | + - name: Compile |
| 138 | + run: | |
| 139 | + tools/travis/dm.sh -DTRAVISBUILDING yogstation.dme || travis_terminate 1 |
| 140 | + |
| 141 | + - name: Prepare Artifacts |
| 142 | + run: | |
| 143 | + mkdir artifacts |
| 144 | + cp yogstation.dmb artifacts |
| 145 | + cp yogstation.rsc artifacts |
| 146 | + |
| 147 | + - name: Upload Artifacts |
| 148 | + uses: actions/upload-artifact@v1 |
| 149 | + with: |
| 150 | + name: DMB + RSC |
| 151 | + path: ${{github.workspace}}/artifacts |
| 152 | + |
| 153 | + - name: Run Tests |
| 154 | + run: | |
| 155 | + tools/travis/run_server.sh |
| 156 | +
|
0 commit comments