|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support |
| 4 | +# documentation. |
| 5 | + |
| 6 | +name: gcc |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: ["master"] |
| 11 | + pull_request: |
| 12 | + branches: ["master"] |
| 13 | + |
| 14 | +env: |
| 15 | + # Path to the solution file relative to the root of the project. |
| 16 | + SOLUTION_FILE_PATH: . |
| 17 | + |
| 18 | + # Configuration type to build. |
| 19 | + # You can convert this to a build matrix if you need coverage of multiple configuration types. |
| 20 | + # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 21 | + BUILD_CONFIGURATION: Release |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read |
| 25 | + |
| 26 | +jobs: |
| 27 | + build: |
| 28 | + runs-on: ubuntu-latest |
| 29 | + |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v3 |
| 32 | + - uses: actions/cache@v3 |
| 33 | + with: |
| 34 | + path: | |
| 35 | + ~/.deno |
| 36 | + ~/.cache/deno |
| 37 | + key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}-${{ hashFiles('**/import_map.json') }} |
| 38 | + - uses: actions/cache@v3 |
| 39 | + id: cache-gcc-13 |
| 40 | + with: |
| 41 | + path: | |
| 42 | + /opt/gcc-latest/ |
| 43 | +
|
| 44 | + key: ${{ runner.os }}-gcc-13 |
| 45 | + - uses: actions/cache@v3 |
| 46 | + with: |
| 47 | + path: | |
| 48 | + /usr/local/share/vcpkg |
| 49 | + ./vcpkg |
| 50 | +
|
| 51 | + key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/xmake.lua') }} |
| 52 | + - uses: actions/cache@v3 |
| 53 | + with: |
| 54 | + path: | |
| 55 | + ~\.xmake |
| 56 | +
|
| 57 | + key: ${{ runner.os }}-xmake-${{ hashFiles('**/xmake.lua') }} |
| 58 | + |
| 59 | + - name: install-gcc-13 |
| 60 | + if: steps.cache-gcc-13.outputs.cache-hit != 'true' |
| 61 | + run: | |
| 62 | + wget http://kayari.org/gcc-latest/gcc-latest.deb && sudo dpkg -i gcc-latest.deb && rm gcc-latest.deb |
| 63 | + - run: | |
| 64 | + export PATH=/opt/gcc-latest/bin:$PATH |
| 65 | + export LD_RUN_PATH=/opt/gcc-latest/lib64 |
| 66 | +
|
| 67 | + - name: vcpkg-action |
| 68 | + |
| 69 | + uses: johnwason/vcpkg-action@v4 |
| 70 | + with: |
| 71 | + triplet: x64-linux-release |
| 72 | + pkgs: "gtest cppunit" |
| 73 | + |
| 74 | + token: ${{ github.token }} |
| 75 | + - name: Setup Deno |
| 76 | + |
| 77 | + uses: denoland/setup-deno@v1.1.0 |
| 78 | + with: |
| 79 | + deno-version: v1.33.1 |
| 80 | + - run: deno task cache |
| 81 | + - uses: xmake-io/github-action-setup-xmake@v1 |
| 82 | + with: |
| 83 | + xmake-version: branch@dev |
| 84 | + actions-cache-folder: ".xmake-cache" |
| 85 | + |
| 86 | + - run: xmake l install.lua |
| 87 | + - run: deno run -A xmake.ts --mode=test --group=test --toolchain=gcc --sdk=/opt/gcc-latest/ |
| 88 | + - run: xmake clean -a |
| 89 | + - run: xmake f --toolchain=gcc --sdk=/opt/gcc-latest/ -y -v --project=. "--file=./xmake.lua" |
| 90 | + - run: xmake build -v -y -w --project=. "--file=./xmake.lua" |
| 91 | + - run: xmake clean -a |
| 92 | + - run: xmake f --toolchain=gcc --sdk=/opt/gcc-latest/ -y -v --project=. "--file=./xmake.lua" --mode=test |
| 93 | + - run: xmake build -v -y -w --project=. "--file=./xmake.lua" --group=test |
| 94 | + - run: xmake run --group=test |
0 commit comments