Skip to content

Commit

Permalink
Initial yaml (this will probably fail miserably)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Jan 21, 2025
1 parent 9d27b87 commit dd43aa8
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
43 changes: 35 additions & 8 deletions .github/workflows/playwright-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run playwright API tests
on: [push]

concurrency:
group: integration-group # ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Playwright-integration-test:
Expand All @@ -14,34 +14,61 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run get_go_version.sh script
id: get-go-version
run: |
chmod +x ./scripts/get_go_version.sh
GO_VERSION=$(./scripts/get_go_version.sh ./go.mod)
echo "::set-output name=go-version::$GO_VERSION"
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "${{ steps.get-go-version.outputs.go-version }}"

- name: Set up Make
run: |
yum update -y
yum install -y make
- name: Copy the example config
run: |
cp ./configs/config.yaml.example ./configs/config.yaml
- name: Create .env file
working-directory: _playwright-tests
run: |
echo "USER1USERNAME=${{ secrets.USER1USERNAME }}" >> .env
echo "USER1PASSWORD=${{ secrets.USER1PASSWORD }}" >> .env
echo "BASE_URL=${{ secrets.BASE_URL }}" >> .env
echo "PROXY=${{ secrets.PROXY }}" >> .env
echo "BASE_URL=http://127.0.0.1:8000 >> .env
echo "TOKEN=apple" >> .env
echo "CI=true" >> .env
- name: Start-up the backend
working-directory: _playwright-tests
run: |
make compose-up
make run
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version-file: ".nvmrc"
node-version-file: "_playwright-tests/.nvmrc"

- name: Install dependencies
working-directory: _playwright-tests
run: yarn install

- name: Install Playwright Browsers
working-directory: _playwright-tests
run: yarn playwright install --with-deps

- name: Run Playwright tests
working-directory: _playwright-tests
run: yarn playwright test

- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: "./playwright-ctrf/playwright-ctrf.json"
report-path: "./_playwright-tests/playwright-ctrf/playwright-ctrf.json"
# pull-request-report: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -54,5 +81,5 @@ jobs:
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report
path: ./_playwright-tests/playwright-report
retention-days: 10
22 changes: 22 additions & 0 deletions scripts/get_go_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Path to the go.mod file
GO_MOD_PATH=$1

# Check if the go.mod file exists
if [[ ! -f "$GO_MOD_PATH" ]]; then
echo "go.mod file not found!"
exit 1
fi

# Extract the Go version from the go.mod file
GO_VERSION=$(grep '^go ' "$GO_MOD_PATH" | awk '{print $2}')

# Check if the Go version was found
if [[ -z "$GO_VERSION" ]]; then
echo "Go version not found in go.mod"
exit 1
fi

# Print the Go version
echo "$GO_VERSION"

0 comments on commit dd43aa8

Please sign in to comment.