-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Acetolyne/new-testing
Adds new testing files
- Loading branch information
Showing
34 changed files
with
641 additions
and
743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
# trunk-ignore-all(checkov/CKV2_GHA_1) | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: build | ||
# Controls when the workflow will run | ||
on: | ||
# Triggers after test.yml | ||
# workflow_run: | ||
# workflows: [functionality] | ||
# types: | ||
# - completed | ||
push: | ||
tags: | ||
- "**" | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
#Job1 | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# outputs: | ||
# cache-key: ${{ steps.build-script.outputs.cache_key }} | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.20.0' | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: build-script | ||
id: build-script | ||
run: | | ||
cd ${{ github.workspace }} | ||
mkdir bin | ||
mkdir bin/flowcat-darwin-arm64 | ||
mkdir bin/flowcat-linux-386 | ||
mkdir bin/flowcat-linux-amd64 | ||
go test release_test.go | ||
if [ `echo $?` -ne 0 ]; then exit 1; fi | ||
ls bin/flowcat-darwin-arm64/ | ||
# echo "${{ hashFiles('bin/flowcat-darwin-arm64/**') }}" | ||
# echo "cache_key=${{ hashFiles('bin/flowcat-darwin-arm64/**') }}" >> $GITHUB_OUTPUT | ||
- name: upload-darwin-arm64-cache | ||
id: darwin-arm64-cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
bin | ||
bin/* | ||
bin/flowcat-darwin-arm64/flowcat | ||
key: ${{ github.sha }} | ||
|
||
- name: upload-linux-386-cache | ||
id: linux-386-cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
bin | ||
bin/* | ||
bin/flowcat-linux-386/flowcat | ||
key: ${{ github.sha }} | ||
|
||
- name: upload-linux-amd64-cache | ||
id: linux-amd64-cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
bin | ||
bin/* | ||
bin/flowcat-linux-amd64/flowcat | ||
key: ${{ github.sha }} | ||
|
||
|
||
release: | ||
name: "Release" | ||
needs: [build] | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: get-cache-key | ||
env: | ||
cache_key: test | ||
run: echo "$cache_key" | ||
|
||
- name: get-cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
bin | ||
bin/* | ||
bin/flowcat-darwin-arm64/flowcat | ||
key: ${{ github.sha }} | ||
#key: test | ||
|
||
- name: "Determine tag" | ||
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
|
||
- name: "Create release" | ||
uses: "actions/github-script@v6" | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const fs = require('fs'); | ||
try { | ||
const response = await github.rest.repos.createRelease({ | ||
draft: true, | ||
generate_release_notes: true, | ||
name: process.env.RELEASE_TAG, | ||
owner: context.repo.owner, | ||
prerelease: false, | ||
repo: context.repo.repo, | ||
tag_name: process.env.RELEASE_TAG, | ||
}); | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: response.data.id, | ||
name: "flowcat-darwin-arm64", | ||
data: await fs.readFileSync("bin/flowcat-darwin-arm64/flowcat") | ||
}); | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: response.data.id, | ||
name: "flowcat-linux-386", | ||
data: await fs.readFileSync("bin/flowcat-linux-386/flowcat") | ||
}); | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: response.data.id, | ||
name: "flowcat-linux-amd64", | ||
data: await fs.readFileSync("bin/flowcat-linux-amd64/flowcat") | ||
}); | ||
core.exportVariable('RELEASE_ID', response.data.id); | ||
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
85 changes: 0 additions & 85 deletions
85
.github/workflows/darwin-arm64 build and functionality.yml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.