Skip to content

Commit

Permalink
Merge pull request #327 from silinternational/feature/actions
Browse files Browse the repository at this point in the history
convert from Codeship to GitHub Actions
  • Loading branch information
briskt authored Feb 22, 2024
2 parents 1c9c69a + 5421c2e commit ce83201
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 136 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test and Publish

on:
push:

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check PSR2
run: docker-compose -f actions-services.yml run --rm app ./check-psr2.sh
- name: Run unit tests
run: docker-compose -f actions-services.yml run --rm app ./run-tests.sh

build-and-publish:
name: Build and Publish
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ vars.DOCKER_ORG }}/idp-id-broker
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 0 additions & 8 deletions .whitesource

This file was deleted.

99 changes: 99 additions & 0 deletions actions-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
version: '2'
services:
testdb:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: r00tp@ss!
MYSQL_DATABASE: test
MYSQL_USER: idbroker
MYSQL_PASSWORD: idbroker

app:
build: .
depends_on:
- testdb
- mfaapi
- u2fsim
working_dir: /data
environment:
APP_ENV: test
EMAIL_SERVICE_accessToken: fake-abc-123
EMAIL_SERVICE_assertValidIp: "false"
EMAIL_SERVICE_baseUrl: http://email
EMAIL_SERVICE_validIpRanges: 192.168.0.0/16
EMAIL_SIGNATURE: Dummy Signature for Automated Tests
EMAILER_CLASS: \Sil\SilIdBroker\Behat\Context\fakes\FakeEmailer
HELP_CENTER_URL: https://help-center
IDP_NAME: Test
MYSQL_HOST: testdb
MYSQL_DATABASE: test
MYSQL_USER: idbroker
MYSQL_PASSWORD: idbroker
API_ACCESS_KEYS: abc123
TEST_SERVER_HOSTNAME: localhost
PASSWORD_PROFILE_URL: https://www.example.com
SUPPORT_EMAIL: support@example.com
HR_NOTIFICATIONS_EMAIL: hr@example.com
ABANDONED_USER_bestPracticeUrl: http://www.example.com/best-practices.html
ABANDONED_USER_deactivateInstructionsUrl: http://www.example.com/deactivate-instructions.html
MFA_WEBAUTHN_apiBaseUrl: mfaapi:8080/
MFA_WEBAUTHN_apiKey: 10345678-1234-1234-1234-123456789012
MFA_WEBAUTHN_apiSecret: 11345678-1234-1234-1234-12345678
MFA_WEBAUTHN_appId: ourApp99
MFA_WEBAUTHN_rpDisplayName: Our App
MFA_WEBAUTHN_rpId: http://app99
U2F_SIM_HOST_AND_PORT: u2fsim:8080

dynamo:
image: amazon/dynamodb-local
ports:
- "8000:8000"
environment:
AWS_ACCESS_KEY_ID: abc123
AWS_SECRET_ACCESS_KEY: abc123
AWS_DEFAULT_REGION: us-east-1
command: "-jar DynamoDBLocal.jar -sharedDb"

# Don't use underscores in service names
mfaapi:
build: ./serverless-mfa-api
ports:
- 8080
environment:
AWS_ENDPOINT: dynamo:8000
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: abc123
AWS_SECRET_ACCESS_KEY: abc123
AWS_DISABLE_SSL: "true"
API_KEY_TABLE: ApiKey
WEBAUTHN_TABLE: WebAuthn
depends_on:
- dynamo
- dynamorestart
working_dir: /src
command: bash -c "echo starting server && go run ./server/"

u2fsim:
build: ./u2f-simulator
ports:
- 8080
working_dir: /src
command: bash -c "echo starting u2f server && go run ./u2fserver/"

# Create dynamodb tables and data before running the backend mfa api
dynamorestart:
build: ./dynamorestart
ports:
- 8080
environment:
AWS_ENDPOINT: dynamo:8000
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: abc123
AWS_SECRET_ACCESS_KEY: abc123
AWS_DISABLE_SSL: "true"
API_KEY_TABLE: ApiKey
WEBAUTHN_TABLE: WebAuthn
depends_on:
- dynamo
working_dir: /dynamo
command: bash -c "php restart.php"
101 changes: 0 additions & 101 deletions codeship-services.yml

This file was deleted.

25 changes: 0 additions & 25 deletions codeship-steps.yml

This file was deleted.

2 changes: 0 additions & 2 deletions dockercfg.encrypted

This file was deleted.

0 comments on commit ce83201

Please sign in to comment.