|
1 | | -name: Run Console Project |
| 1 | +name: Run Console |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
|
7 | 7 | description: 'Branch' |
8 | 8 | required: false |
9 | 9 | default: 'develop' |
10 | | - runner: |
11 | | - type: choice |
12 | | - description: 'Runner' |
13 | | - required: true |
14 | | - default: 'self-hosted' |
15 | | - options: |
16 | | - - ubuntu-22.04 |
17 | | - - self-hosted |
18 | 10 |
|
19 | 11 | jobs: |
20 | 12 | run-console: |
21 | | - runs-on: ${{ github.event.inputs.runner }} |
| 13 | + runs-on: ubuntu-22.04 |
22 | 14 |
|
23 | 15 | steps: |
24 | | - - name: Clone Private Repository |
| 16 | + - name: Clone repository |
25 | 17 | env: |
26 | 18 | PAT_TOKEN: ${{ secrets.PAT_TOKEN }} |
27 | 19 | run: | |
28 | | - git clone --branch ${{ github.event.inputs.branch || 'develop' }} https://x-access-token:${PAT_TOKEN}@github.com/educup/educup-server.git |
| 20 | + git clone --depth 1 --branch ${{ github.event.inputs.branch || 'develop' }} https://x-access-token:${PAT_TOKEN}@github.com/educup/educup-server.git |
29 | 21 |
|
30 | | - - name: Setup .NET Core 3.1.x |
| 22 | + - name: Setup wireguard |
| 23 | + env: |
| 24 | + VPN_CONFIG: ${{ secrets.VPN_CONFIG }} |
| 25 | + run: | |
| 26 | + sudo apt-get update && sudo apt-get install -y wireguard resolvconf |
| 27 | + echo "$VPN_CONFIG" | sudo tee /etc/wireguard/wg0.conf |
| 28 | + sudo wg-quick up wg0 |
| 29 | +
|
| 30 | + - name: Install dotnet |
31 | 31 | uses: actions/setup-dotnet@v4 |
32 | 32 | with: |
33 | 33 | dotnet-version: '3.1.x' |
34 | | - env: |
35 | | - DOTNET_INSTALL_DIR: $HOME/dotnet |
36 | 34 |
|
37 | | - - name: Add .NET to PATH |
38 | | - run: | |
39 | | - echo 'export PATH=$PATH:$HOME/dotnet' >> ~/.bashrc |
40 | | - source ~/.bashrc |
| 35 | + - name: Config cache |
| 36 | + uses: actions/cache@v4 |
| 37 | + with: |
| 38 | + path: ~/.nuget/packages |
| 39 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} |
| 40 | + restore-keys: | |
| 41 | + ${{ runner.os }}-3dot1-nuget-v1 |
41 | 42 |
|
42 | | - - name: Restore .NET packages |
| 43 | + - name: Restore packages |
43 | 44 | run: dotnet restore educup-server/Playground/VAConsole/VAConsole.csproj --locked-mode |
44 | 45 |
|
45 | | - - name: Build the project |
46 | | - run: dotnet build educup-server/Playground/VAConsole/VAConsole.csproj --configuration Release |
| 46 | + - name: Build project |
| 47 | + run: dotnet build educup-server/Playground/VAConsole/VAConsole.csproj -c Release |
47 | 48 |
|
48 | | - - name: Run the console project |
49 | | - run: dotnet run --project educup-server/Playground/VAConsole/VAConsole.csproj --configuration Release |
| 49 | + - name: Run project |
| 50 | + working-directory: educup-server/Playground/VAConsole/bin/Release/netcoreapp3.1 |
| 51 | + run: dotnet VAConsole.dll |
0 commit comments