Expand README and CI

This commit is contained in:
Nick Alteen
2023-09-15 12:32:38 -04:00
parent 5d385f5f67
commit 99b422f0cb
5 changed files with 447 additions and 3 deletions

17
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
labels:
- dependabot
- actions
schedule:
interval: daily
- package-ecosystem: docker
directory: /
labels:
- dependabot
- docker
schedule:
interval: daily

104
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,104 @@
name: Continuous Integration
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test-typescript:
name: TypeScript Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: Install Dependencies
id: npm-ci
run: npm ci
- name: Check Format
id: npm-format-check
run: npm run format:check
- name: Lint
id: npm-lint
run: npm run lint
- name: Test
id: npm-ci-test
run: npm run ci-test
test-docker:
name: Docker Tests
runs-on: ubuntu-latest
# Run a local registry to push to
services:
registry:
image: registry:2
ports:
- 5001:5000
env:
TEST_TAG: localhost:5001/actions/container-toolkit-action:latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Setup Docker BuildX
id: setup-buildx
uses: docker/setup-buildx-action@v3
with:
install: true
driver-opts: network=host
- name: Build the Container
id: build
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.TEST_TAG }}
- name: Run the Container
id: run
env:
INPUT_MILLISECONDS: 2000
run: |
docker run \
--env INPUT_MILLISECONDS="${{ env.INPUT_MILLISECONDS }}" \
--rm ${{ env.TEST_TAG }}
test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Test Local Action
id: test-action
uses: ./
with:
milliseconds: 2000
- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"

48
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: CodeQL
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '31 7 * * 3'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
checks: write
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language:
- TypeScript
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
source-root: src
- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v2