Skip to content

Commit

Permalink
build: Update Github actions (#1734)
Browse files Browse the repository at this point in the history
* build: Update Github actions

* Try upgrading eslint

* Try using yarn instead of npm

* Remove build command

* Update Github script
  • Loading branch information
faucomte97 committed Dec 19, 2022
1 parent 917a579 commit 0ed8ca5
Show file tree
Hide file tree
Showing 7 changed files with 323 additions and 50 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Install dependencies
run: |
pip install pipenv==2022.10.4
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Run Python tests
run: pytest --cov=. --cov-report=xml aimmo
- name: Run Cypress tests
uses: cypress-io/github-action@v2
uses: cypress-io/github-action@v5
with:
browser: chrome
install: false
Expand All @@ -58,14 +58,14 @@ jobs:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

test-aimmo-game:
name: Test aimmo-game
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build docker image
Expand All @@ -80,14 +80,14 @@ jobs:
docker cp -a $CONTAINERID:.coverage $(pwd)/.coverage
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

test-aimmo-game-creator:
name: Test aimmo-game-creator
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build docker image
Expand All @@ -102,14 +102,14 @@ jobs:
docker cp -a $CONTAINERID:.coverage $(pwd)/.coverage
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

test-aimmo-game-worker:
name: Test aimmo-game-worker
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build docker image
Expand All @@ -124,4 +124,4 @@ jobs:
docker cp -a $CONTAINERID:.coverage $(pwd)/.coverage
docker cp -a $CONTAINERID:coverage.xml $(pwd)/coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
18 changes: 9 additions & 9 deletions .github/workflows/publish-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -33,7 +33,7 @@ jobs:
echo "::set-output name=tag::${GITHUB_REF:11}" # this is either branch name or tag after first character ('v')
- name: Build and push aimmo-game image
id: game
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: aimmo-game
file: aimmo-game/Dockerfile
Expand All @@ -44,7 +44,7 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Build and push aimmo-game-creator image
id: game_creator
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: aimmo-game-creator
file: aimmo-game-creator/Dockerfile
Expand All @@ -64,11 +64,11 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Trigger staging deployment
uses: actions/github-script@v4
uses: actions/github-script@v6
with:
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
script: |
github.actions.createWorkflowDispatch({
github.rest.actions.createWorkflowDispatch({
owner: 'ocadotechnology',
repo: 'codeforlife-deploy-appengine',
workflow_id: 'deploy_staging.yml',
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jobs:
NODE_ENV: production
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Install frontend dependencies
run: |
cd game_frontend
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pull-request-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
name: Validate PR title
runs-on: ubuntu-20.04
steps:
- uses: amannn/action-semantic-pull-request@v4
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 7 additions & 5 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@ jobs:
LANG: C.UTF-8
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 16.x
- name: Install Node dependencies
run: npm install --prefix game_frontend
run: |
cd game_frontend
yarn --frozen-lockfile
- name: Run Snyk to check for vulnerabilities in Node.js
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor --file=game_frontend/package.json --package-manager=npm --project-name="aimmo_frontend"
- name: Setup python-version
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"
Expand Down
2 changes: 1 addition & 1 deletion game_frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.3.5",
"eslint": "^6.8.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^7.1.0",
"eslint-config-standard": "^14.1.0",
"eslint-config-standard-react": "^9.2.0",
Expand Down
Loading

0 comments on commit 0ed8ca5

Please sign in to comment.