Skip to content

Commit

Permalink
wip: migration from Travis CI to GitHub Actions #149
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-greffe committed Dec 9, 2023
1 parent 1d690dc commit c0521e6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

chmod +x ./.github/workflows/env.sh
./.github/workflows/env.sh

check_code()
{
if [[ $1 -ne $2 ]]; then
Expand All @@ -11,6 +8,12 @@ check_code()
fi
}

#
# Provision the required files
#
chmod +x ./.github/workflows/env.sh
./.github/workflows/env.sh

#
# Build the app
#
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parse_semver()
#
# Provision the required files
#
echo "##[group]Provision"

# Define the application name
APP=$(node -p -e "require('./package.json').name")
Expand Down Expand Up @@ -70,4 +71,6 @@ fi
# Clone the project and install the dependencies
node . $APP.js --clone
node . $APP.js --install
node . $APP.js --link
node . $APP.js --link

echo "##[endgroup]"
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Build & Deploy
on: [push]
env:
TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }}

jobs:
test:
if: ${{ !contains(github.event.head_commit.message, '[skip test]') }}
runs-on: ubuntu-latest
env:
env:
DB_URL: "mongodb://mongo:27017"
steps:
- uses: actions/checkout@v4
Expand All @@ -23,10 +25,9 @@ jobs:
build:
if: ${{ !contains(github.event.head_commit.message, '[skip app]') }}
runs-on: ubuntu-latest
env:
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
echo "Running tests"

#
# Provision the required files
#
chmod +x ./.github/workflows/env.sh
./.github/workflows/env.sh

#
# Run backend tests
#
cd api
yarn
yarn test

0 comments on commit c0521e6

Please sign in to comment.