Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
solodkiy committed Sep 29, 2024
1 parent 0b4b898 commit c2bd392
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI Workflow

on:
push:
branches:
- main
tags:
- '*'
pull_request:

jobs:
unit_test:
name: Unit Tests
runs-on: ubuntu-latest
container:
image: golang:1.21
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run unit tests
run: go test -v ./...

compile:
name: Build
runs-on: ubuntu-latest
container:
image: golang:1.21
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Compile Go application
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gauge-exporter -buildvcs=false -ldflags "-X main.appVersion=${{ github.ref_name }}"

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: gauge-exporter
path: gauge-exporter
retention-days: 1

e2e_test:
name: End-to-End Tests
runs-on: ubuntu-latest
container:
image: php:8.3
needs: compile
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: gauge-exporter

- name: Install dependencies
uses: php-actions/composer@v6
env:
COMPOSER: "composer.json"
with:
php_version: "8.3"
version: "2.2"
args: "--optimize-autoloader"
working_dir: "e2e_tests"

- name: Run E2E tests
run: ./vendor/bin/phpunit --testdox
working-directory: e2e_tests


0 comments on commit c2bd392

Please sign in to comment.