Skip to content

Commit

Permalink
Extract e2e test environment variables into file.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpass99 committed Jan 24, 2024
1 parent e27f6e1 commit 6fbc11b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,14 @@ jobs:
runs-on: ubuntu-latest
needs: [ compile, test ]
env:
POSEIDON_AWS_ENABLED: false
POSEIDON_AWS_ENDPOINT: ${{ secrets.POSEIDON_AWS_ENDPOINT }}
POSEIDON_AWS_FUNCTIONS: ""
POSEIDON_LOGGER_FORMATTER: "JSONFormatter"
POSEIDON_LOG_FILE: "../../poseidon.log"
POSEIDON_NOMAD_DISABLEFORCEPULL: true
GOCOVERDIR: coverage
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Handle Environment Variables
run: |
cat ./.github/workflows/resources/.env | envsubst > ./.github/workflows/resources/.env
export $(cat ./.github/workflows/resources/.env | xargs)
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -210,16 +208,14 @@ jobs:
./poseidon | tee poseidon.log &
until curl -s --fail http://localhost:7200/api/v1/health ; do sleep 1; done
make e2e-test
- name: Write Environment Variables to file
run: |
echo "${{ vars }}"
if: ${{ success() || failure() }}
- name: Setup Poseidon Socket
run: |
killall poseidon
mkdir -p ~/.config/systemd/user
cp ./.github/workflows/resources/poseidon-minimal.socket ~/.config/systemd/user/poseidon.socket
cat ./.github/workflows/resources/poseidon-minimal.service | envsubst > ~/.config/systemd/user/poseidon.service
echo "POSEIDON_SERVER_SYSTEMDSOCKETACTIVATION=TRUE" >> ./.github/workflows/resources/.env
systemctl --user daemon-reload
systemctl --user start poseidon.socket
if: ${{ success() || failure() }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/resources/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
POSEIDON_AWS_ENABLED="false"
POSEIDON_AWS_ENDPOINT="${POSEIDON_AWS_ENDPOINT}"
POSEIDON_AWS_FUNCTIONS=""
POSEIDON_LOGGER_FORMATTER="JSONFormatter"
POSEIDON_LOG_FILE="../../poseidon.log"
POSEIDON_NOMAD_DISABLEFORCEPULL="true"
GOCOVERDIR="coverage"
3 changes: 1 addition & 2 deletions .github/workflows/resources/poseidon-minimal.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Requires=poseidon.socket
[Service]
WorkingDirectory=${GITHUB_WORKSPACE}
ExecStart=${GITHUB_WORKSPACE}/poseidon
Environment="POSEIDON_SERVER_SYSTEMDSOCKETACTIVATION=TRUE"
Environment="GOCOVERDIR=${GITHUB_WORKSPACE}/${GOCOVERDIR}"
EnvironmentFile=${GITHUB_WORKSPACE}/.github/workflows/resources/.env

Restart=always
StartLimitBurst=0
Expand Down

0 comments on commit 6fbc11b

Please sign in to comment.