Skip to content

Commit d3e0c5e

Browse files
committed
Test github actions
1 parent 73da460 commit d3e0c5e

File tree

1 file changed

+54
-65
lines changed

1 file changed

+54
-65
lines changed

.github/workflows/main.yml

Lines changed: 54 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ jobs:
3131
- name: Checkout repository
3232
uses: actions/checkout@v4
3333

34+
- name: Set Custom Build Variables
35+
uses: ./.github/actions/set-custom-build-variables
36+
37+
- name: Deployment request status
38+
if: env.should_deploy == 'true'
39+
run: echo "ENABLED (if you see this)"
40+
3441
- name: Current builder/repo info
3542
run: |
3643
echo "Running builder at `pwd` as `whoami`@`hostname` on `uname -a`"
@@ -42,39 +49,8 @@ jobs:
4249
echo "--- PARENT DIRECTORY ---"
4350
ls -la ..
4451
45-
- name: Set Custom Build Variables
46-
uses: ./.github/actions/set-custom-build-variables
47-
48-
- name: Set variables and set deployment flag
49-
id: set_variables
50-
run: |
51-
echo "--- Deployment ---"
52-
should_deploy=false
53-
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${{ github.event.inputs.deploy }}" == "true" ]]; then
54-
echo "Note: activating should_deploy because of workflow_dispatch with true input for deployment"
55-
should_deploy=true
56-
elif [[ "${GITHUB_EVENT_NAME}" != "pull_request" && "${{ github.event.head_commit.message }}" =~ \[DEPLOYMENT\] ]]; then
57-
echo "Note: activating should_deploy because of non-pull request with marker in the commit message"
58-
should_deploy=true
59-
else
60-
echo "Note: not activating should_deploy"
61-
fi
62-
echo "should_deploy=$should_deploy" >> $GITHUB_ENV
63-
echo "--- Creating faked TRAVIS-compatible variables ---"
64-
echo "TRAVIS=true" >> $GITHUB_ENV
65-
echo "TRAVIS_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
66-
echo "TRAVIS_COMMIT=$GITHUB_SHA" >> $GITHUB_ENV
67-
echo "TRAVIS_JOB_WEB_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV
68-
echo "TRAVIS_OS_NAME=$(uname | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
69-
echo "TRAVIS_PULL_REQUEST=${{ github.event.pull_request.number || 'false' }}" >> $GITHUB_ENV
70-
echo "TRAVIS_REPO_SLUG=${{ github.repository }}" >> $GITHUB_ENV
71-
echo "--- Result ---"
72-
ls -l $GITHUB_ENV || true
73-
cat $GITHUB_ENV || true
74-
75-
- name: Deployment request status
76-
if: env.should_deploy == 'true'
77-
run: echo "ENABLED (if you see this)"
52+
- name: Show shell variables
53+
run: env || true
7854

7955
- name: Install Ubuntu packages
8056
run: |
@@ -85,10 +61,25 @@ jobs:
8561
run: dpkg -l | cat || true
8662

8763
- name: Show system status
88-
run: cat /etc/debian_version ; lsb_release -a ; yacc --version | head -n 1 ; gcc --version | head -n 1 ; g++ --version | head -n 1 ; make --version | head -n 1 ; git --version | head -n 1 ; gawk --version | head -n 1 ; bash --version | head -n 1 ; uname -a ; id -a ; echo "CWD is `pwd`" ; echo "PATH is $PATH" ; echo "Hostname is `hostname`" ; sudo lscpu || true ; uptime ; sudo /sbin/ip a || true ; df -h . ; ls -la .
89-
90-
- name: Show shell variables
91-
run: env || true
64+
run: |
65+
cat /etc/debian_version
66+
lsb_release -a
67+
yacc --version | head -n 1
68+
gcc --version | head -n 1
69+
g++ --version | head -n 1
70+
make --version | head -n 1
71+
git --version | head -n 1
72+
gawk --version | head -n 1
73+
bash --version | head -n 1
74+
uname -a
75+
id -a
76+
echo "CWD is `pwd`"
77+
echo "PATH is $PATH"
78+
echo "Hostname is `hostname`"
79+
sudo lscpu || true
80+
uptime
81+
sudo /sbin/ip a || true
82+
df -h .
9283
9384
- name: Show native SDL2 status
9485
run: |
@@ -172,6 +163,13 @@ jobs:
172163
- name: Checkout repository
173164
uses: actions/checkout@v4
174165

166+
- name: Set Custom Build Variables
167+
uses: ./.github/actions/set-custom-build-variables
168+
169+
- name: Deployment request status
170+
if: env.should_deploy == 'true'
171+
run: echo "ENABLED (if you see this)"
172+
175173
- name: Current builder/repo info
176174
run: |
177175
echo "Running builder at `pwd` as `whoami`@`hostname` on `uname -a`"
@@ -183,35 +181,29 @@ jobs:
183181
echo "--- PARENT DIRECTORY ---"
184182
ls -la ..
185183
186-
- name: Set Custom Build Variables
187-
uses: ./.github/actions/set-custom-build-variables
188-
189-
- name: Set should-deploy flag
190-
id: set_deploy
191-
run: |
192-
should_deploy=false
193-
if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${{ github.event.inputs.deploy }}" == "true" ]]; then
194-
echo "Note: activating should_deploy because of workflow_dispatch with true input for deployment"
195-
should_deploy=true
196-
elif [[ "${GITHUB_EVENT_NAME}" != "pull_request" && "${{ github.event.head_commit.message }}" =~ \[DEPLOYMENT\] ]]; then
197-
echo "Note: activating should_deploy because of non-pull request with marker in the commit message"
198-
should_deploy=true
199-
else
200-
echo "Note: not activating should_deploy"
201-
fi
202-
echo "should_deploy=$should_deploy" >> $GITHUB_ENV
203-
echo "should_deploy=$should_deploy"
204-
echo "TESTVAR=TESTTEST" >> $GITHUB_ENV
205-
ls -l $GITHUB_ENV || true
206-
cat $GITHUB_ENV || true
207-
208-
- name: Deployment request status
209-
if: env.should_deploy == 'true'
210-
run: echo "ENABLED (if you see this)"
184+
- name: Show shell variables
185+
run: env || true
211186

212187
- name: Install build/deployment dependencies
213188
run: build/install-dependencies-osx.sh
214189

190+
- name: Show system status
191+
run: |
192+
sw_vers || true
193+
gcc --version | head -n 1
194+
g++ --version | head -n 1
195+
make --version | head -n 1
196+
git --version | head -n 1
197+
bash --version | head -n 1
198+
uname -a
199+
id -a
200+
echo "CWD is `pwd`"
201+
echo "PATH is $PATH"
202+
echo "Hostname is `hostname`"
203+
uptime
204+
ifconfig || true
205+
df -h .
206+
215207
- name: Show Mac SDL2 status
216208
run: |
217209
ls -l `which sdl2-config` || true
@@ -229,9 +221,6 @@ jobs:
229221
- name: Uptime/load so far
230222
run: uptime
231223

232-
- name: TEST ONLY REMOVE THIS
233-
run: echo ${{ env.should_deploy }} ; echo ${{ env.TESTVAR }}
234-
235224
- name: Deployment
236225
if: env.should_deploy == 'true'
237226
run: |

0 commit comments

Comments
 (0)