Skip to content

Commit

Permalink
Refactor yaml string format for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Grayson committed Mar 8, 2024
1 parent 7a3a78d commit 79abf6c
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 115 deletions.
53 changes: 23 additions & 30 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
- develop
- production
paths:
- 'backend/**'
- '.github/workflows/backend.yml'
- backend/**
- .github/workflows/backend.yml
pull_request:
branches:
- develop
- production
paths:
- 'backend/**'
- '.github/workflows/backend.yml'
- backend/**
- .github/workflows/backend.yml

defaults:
run:
Expand All @@ -28,14 +28,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Lint
Expand All @@ -47,14 +46,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Run site locally
Expand All @@ -80,14 +78,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build
Expand All @@ -113,13 +110,12 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v5.0.0
with:
python-version: '3.10'
python-version: 3.10
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
pip-
key: pip-${{ hashFiles(**/requirements.txt) }}
restore-keys: pip-
- run: pip install -r worker/requirements.txt
- run: pytest
build_worker:
Expand All @@ -129,14 +125,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build worker container
Expand All @@ -152,14 +147,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

Expand Down Expand Up @@ -203,14 +197,13 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: 3.11
# We need the Go version and Go cache location for the actions/cache step,
# so the Go installation must happen before that.
- id: setup-go
Expand All @@ -56,11 +56,10 @@ jobs:
# There is no expectation for actual Go code so we disable caching as
# it relies on the existence of a go.sum file.
cache: false
go-version: "1.20"
go-version: 1.20
- name: Lookup Go cache directory
id: go-cache
run: |
echo "dir=$(go env GOCACHE)" >> $GITHUB_OUTPUT
run: echo "dir=$(go env GOCACHE)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
Expand All @@ -84,8 +83,7 @@ jobs:
${{ hashFiles('**/requirements-test.txt') }}-\
${{ hashFiles('**/requirements.txt') }}-\
${{ hashFiles('**/.pre-commit-config.yaml') }}"
restore-keys: |
${{ env.BASE_CACHE_KEY }}
restore-keys: ${{ env.BASE_CACHE_KEY }}
- name: Setup curl cache
run: mkdir -p ${{ env.CURL_CACHE_DIR }}
- name: Install Packer
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: "CodeQL"
name: CodeQL

on:
push:
branches: ["develop", "production"]
branches: [develop, production]
pull_request:
branches: ["develop"]
branches: [develop]
schedule:
- cron: "23 17 * * 6"

Expand Down
27 changes: 8 additions & 19 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ on:
branches:
- develop
paths:
- 'docs/**'
- 'backend/**'
- '.github/workflows/docs.yml'
- docs/**
- backend/**
- .github/workflows/docs.yml
pull_request:
branches:
- develop
paths:
- 'docs/**'
- 'backend/**'
- '.github/workflows/docs.yml'
- docs/**
- backend/**
- .github/workflows/docs.yml

defaults:
run:
Expand All @@ -28,28 +28,17 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: 18
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libvips-dev glib2.0-dev
- run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build
# - name: Deploy to GitHub Pages
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# uses: crazy-max/ghaction-github-pages@v3.0.0
# with:
# keep_history: false
# target_branch: gh-pages
# build_dir: docs/public
# fqdn: docs.crossfeed.cyber.dhs.gov
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 4 additions & 8 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Lint
Expand All @@ -53,8 +52,7 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build
Expand All @@ -77,8 +75,7 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Build Staging
Expand Down Expand Up @@ -107,8 +104,7 @@ jobs:
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
restore-keys: ${{ runner.os }}-node-
- name: Install dependencies
run: npm ci

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:
- develop
- production
paths:
- 'infrastructure/**'
- '.github/workflows/infrastructure.yml'
- infrastructure/**
- .github/workflows/infrastructure.yml
pull_request:
branches:
- develop
- production
paths:
- 'infrastructure/**'
- '.github/workflows/infrastructure.yml'
- infrastructure/**
- .github/workflows/infrastructure.yml

defaults:
run:
Expand All @@ -25,12 +25,12 @@ jobs:
format:
runs-on: ubuntu-latest
env:
URL: "https://releases.hashicorp.com/terraform/1.0.7/terraform_1.0.7_linux_amd64.zip"
URL: https://releases.hashicorp.com/terraform/1.0.7/terraform_1.0.7_linux_amd64.zip
steps:
- uses: actions/checkout@v3
- name: Install Terraform
run: |
wget $URL
wget ${{ env.URL }}
unzip terraform_1.0.7_linux_amd64.zip
sudo mv terraform /usr/local/bin
Expand All @@ -47,7 +47,7 @@ jobs:

- name: Install Terraform
run: |
wget $URL
wget ${{ env.URL }}
unzip terraform_1.0.7_linux_amd64.zip
sudo mv terraform /usr/local/bin
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:

- name: Install Terraform
run: |
wget $URL
wget ${{ env.URL }}
unzip terraform_1.0.7_linux_amd64.zip
sudo mv terraform /usr/local/bin
Expand Down
Loading

0 comments on commit 79abf6c

Please sign in to comment.